Skip to content

pantoken / platforms/wordpress/src / toThemeJson

Mahi: toThemeJson()

toThemeJson(tokens, options?): ThemeJson

Whakamātautau

Huri i te rārangi tohu IR kia theme.json mō WordPress.

Ngā Tawhā

tokens

panui-anake Token[]

Te IR (hei tauira, nō @pantoken/tokens).

options?

ToThemeJsonOptions = {}

ToThemeJsonOptions.

Whakahokia

ThemeJson

He tuhinga theme.json.

Ngā tauira

Huri te IR ki te theme.json mō te aratau-mārama

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

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

Aratau pōuri

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

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