Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Fonksyon: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Eksperimantal

Konstwi fichye pou yon sou-tèm Drupal ki chaje Instructure tokens yo.

Paramèt

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Retounen

DrupalFile[]

Fichye tèm yo, chemen relatif ak repètwa tèm lan.

Egzanp

Konstwi epi ekri yon sou-tèm endepandan

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

Konstwi yon sou-tèm sou yon tèm baz

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

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