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