Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

פונקציה: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

ניסיוני

בנה את הקבצים עבור תת-נושא של Drupal הטוען את הטוקנים של Instructure.

פרמטרים

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

מחזיר

DrupalFile[]

קבצי התבנית, נתיבים יחסיים לתיקיית התבנית.

דוגמאות

בנה וכתוב תת-נושא עצמאי

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);
}

בנה תת-נושא על גבי ערכת נושא בסיסית

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

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