Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Ֆունկցիա: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Փորձարկումային

Ստեղծել ֆայլերը Drupal ենթաթեմի համար, որը բեռնում է Instructure տոկենները։

Պարամետրեր

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