Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Fall: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Tilrauna

Byggja skrárnar fyrir Drupal undirþema sem hleður Instructure tokens.

Færibreytur

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Skilar

DrupalFile[]

Þemaskrárnar, slóðir miðaðar við þema möppu.

Dæmi

Byggja og skrifa sjálfstætt undirþema

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

Byggja undirþema ofan á grunnþema

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

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