Skip to content

pantoken / platforms/vanilla/src / toVanillaVariables

Fušla: toVanillaVariables()

toVanillaVariables(tokens, options?): Record<string, unknown>

Eksperimentála

Geahččat IR-tokenlistta Vanilla Foundation variables.json-objektaksi.

Parametera

tokens

ruvvojuvvon Token[]

IR (go @pantoken/tokens.)

options?

ToVanillaOptions = {}

ToVanillaOptions.

Gullii / Gávdnat

Record<string, unknown>

Guovddáš variabelain objektta mii PUT:dat theme's variables.json-assetaas.

Exempla

Geahččat IR guovddáš variabelaobjektas

ts
import { toVanillaVariables } from "@pantoken/vanilla";
import { byTheme } from "@pantoken/tokens";

const vars = toVanillaVariables(byTheme("rebrand"));
// { global: { mainColors: { primary: "#…" }, … }, titleBar: { … }, button: { … } }

Gaskavuohta-mode

ts
import { toVanillaVariables } from "@pantoken/vanilla";
import { byTheme } from "@pantoken/tokens";

const vars = toVanillaVariables(byTheme("canvas"), { mode: "dark" });