Skip to content

pantoken / formats/stylus/src / toStylus

Fall: toStylus()

toStylus(tokens, options?): string

Tilrauna

Gefur út Stylus-breytur fyrir token IR.

Færibreytur

tokens

readonly Token[]

IR-ið (t.d. frá @pantoken/tokens).

options?

ToStylusOptions = {}

ToStylusOptions.

Skilar

string

Stylus upprunastrengurinn.

Dæmi

Gefðu út sjálfgefnu (ljósu) breyturnar

ts
import { toStylus } from "@pantoken/stylus";
import { tokens } from "@pantoken/tokens";

toStylus(tokens); // "instui-color-brand = #0374b5\n…"

Leysa dökka stillingu annars þema

ts
import { toStylus } from "@pantoken/stylus";
import { byTheme } from "@pantoken/tokens";

toStylus(byTheme("canvas"), { mode: "dark" });