Skip to content

pantoken / formats/stylus/src / toStylus

Feidhm: toStylus()

toStylus(tokens, options?): string

Turgnamhach

Eisigh athróga Stylus do IR token.

Paraiméadair

tokens

neamh-inathraitheach Token[]

An IR (m.sh. ó @pantoken/tokens).

options?

ToStylusOptions = {}

ToStylusOptions.

Tuairisceáin

string

An sreang fhoinse Stylus.

Samplaí

Scaoil na hathróga réamhshocraithe (éadrom)

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

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

Réitigh mód dorcha téama eile

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

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