Skip to content

pantoken / formats/stylus/src / toStylus

Swyddogaeth: toStylus()

toStylus(tokens, options?): string

Arbrofol

Allbwn newidynnau Stylus ar gyfer IR tocyn.

Paramedrau

tokens

darllen-yn-unig Token[]

Yr IR (er enghraifft o @pantoken/tokens).

options?

ToStylusOptions = {}

ToStylusOptions.

Yn dychwelyd

string

Y llinyn ffynhonnell Stylus.

Enghreifftiau

Allanoli'r newidiolion diofyn (golau)

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

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

Datrys modd tywyll ar gyfer thema arall

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

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