Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Funksjon: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Eksperimentell

Bygg filene for eit Drupal-undertema som lastar inn Instructure tokens.

Parametrar

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Returnerer

DrupalFile[]

Temafilene, stiar relative til temakatalogen.

Døme

Bygg og skriv eit frittståande 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);
}

Bygg eit undertema ovanpå eit basetema

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

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