Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Funktion: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Eksperimentel

Byg filerne for et Drupal-undertema, der indlæser Instructure-tokens.

Parametre

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Returnerer

DrupalFile[]

Temafiler, stier relative til temamappe.

Eksempler

Byg og skriv et selvstændigt undertema

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

Byg et undertema på toppen af et basistema

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

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