Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

फंक्शन: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

प्रयोगात्मक

Instructure टोकन लोड करने वाले Drupal सब-थीम के लिए फ़ाइलें बनाएं।

पैरामीटर

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

वापसी

DrupalFile[]

थीम फ़ाइलें, थीम निर्देशिका के सापेक्ष पथ।

उदाहरण

एक स्टैंडअलोन सब-थीम बनाएं और लिखें

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

बेस थीम के ऊपर एक सब-थीम बनाएं

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

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