Skip to content

pantoken / formats/scss/src / toScss

Swyddogaeth: toScss()

toScss(tokens, options?): string

Arbrofol

Generadu newidynnau SCSS ar gyfer IR tocyn.

Paramedrau

tokens

darllen-yn-unig Token[]

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

options?

ToScssOptions = {}

ToScssOptions.

Yn dychwelyd

string

Y llinyn ffynhonnell SCSS.

Enghreifftiau

Allanoli'r newidiolion diofyn (golau)

ts
import { toScss } from "@pantoken/scss";
import { tokens } from "@pantoken/tokens";

toScss(tokens); // "$instui-color-brand: #0374b5;\n…"

Datrys modd tywyll ar gyfer thema arall

ts
import { toScss } from "@pantoken/scss";
import { byTheme } from "@pantoken/tokens";

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