Skip to content

pantoken / platforms/drupal/src / toDrupalTheme

Función: toDrupalTheme()

toDrupalTheme(options?): DrupalFile[]

Experimental

Construir los archivos para un subtema de Drupal que cargue los tokens de Instructure.

Parámetros

options?

ToDrupalThemeOptions = {}

ToDrupalThemeOptions.

Devuelve

DrupalFile[]

Los archivos del tema, rutas relativas al directorio del tema.

Ejemplos

Construir y escribir un subtema independiente

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

Construir un subtema sobre un tema base

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

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