Skip to content

pantoken / platforms/wordpress/src / toThemeJson

Fušla: toThemeJson()

toThemeJson(tokens, options?): ThemeJson

Eksperimentála

Geavahit IR-tokenlistu WordPress theme.json-sse.

Parametera

tokens

ruvvojuvvon Token[]

IR (go @pantoken/tokens.)

options?

ToThemeJsonOptions = {}

ToThemeJsonOptions.

Gullii / Gávdnat

ThemeJson

theme.json dokumenta.

Exempla

Gevrret IR light-mode theme.json:ksi

ts
import { toThemeJson } from "@pantoken/wordpress";
import { byTheme } from "@pantoken/tokens";

const doc = toThemeJson(byTheme("rebrand"));
doc.settings.color.palette; // [{ slug, name, color }, …]

Gaskavuohta-mode

ts
import { toThemeJson } from "@pantoken/wordpress";
import { byTheme } from "@pantoken/tokens";

const doc = toThemeJson(byTheme("canvas"), { mode: "dark" });