Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Functie: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Experimenteel

Maak de bestanden voor een Drupal-subthema dat de Instructure-tokens laadt.

Parameters

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Retourneert

DrupalFile[]

De themabestanden, paden relatief ten opzichte van de themamap.

Voorbeelden

Bouw en schrijf een zelfstandig subthema

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

Bouw een subthema bovenop een basisthema

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

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