Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Funkcja: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Eksperymentalne

Zbuduj pliki dla podmotywu Drupala, który ładuje tokeny Instructure.

Parametry

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Zwraca

DrupalFile[]

Pliki motywu, ścieżki względem katalogu motywu.

Przykłady

Zbuduj i zapisz samodzielny podmotyw

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

Zbuduj podmotyw oparty na motywie bazowym

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

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