Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Funkcija: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Eksperimentalno

Zgradi datoteke za Drupal pod-temo, ki naloži Instructure tokene.

Parametri

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Vrne

DrupalFile[]

Datoteke teme, poti relativno glede na imenik teme.

Primeri

Zgradi in zapiši samostojno pod-temo

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

Zgradi pod-temo na osnovi osnovne teme

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

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