Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Függvény: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Kísérleti

A Drupal al-téma fájljainak felépítése, amely betölti az Instructure tokeneket.

Paraméterek

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Visszatérés

DrupalFile[]

A téma fájljai, elérési utak a témakönyvtárhoz képest.

Példák

Önálló al-téma felépítése és írása

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

Al-téma felépítése egy alapszínre vonatkozóan

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

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