Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Funktion: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Experimentell

Erstelle die Dateien für ein Drupal-Sub-Theme, das die Instructure-Token lädt.

Parameter

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Rückgabe

DrupalFile[]

Die Theme-Dateien, Pfade relativ zum Theme-Verzeichnis.

Beispiele

Erstelle und schreibe ein eigenständiges Sub-Theme

ts
import { writeFileSync, mkdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { toDrupalTheme } from "@pantoken/drupal";

const files = toDrupalTheme({ name: "Instructure" });
// [ instructure.info.yml, instructure.libraries.yml, css/tokens.css, css/pantoken-prose.css ]
for (const { path, content } of files) {
  const dest = join("./themes/custom/instructure", path);
  mkdirSync(dirname(dest), { recursive: true });
  writeFileSync(dest, content);
}

Erstelle ein Sub-Theme auf Basis eines Basisthemas

ts
import { toDrupalTheme } from "@pantoken/drupal";

const files = toDrupalTheme({ name: "Instructure", baseTheme: "olivero" });