Skip to content

pantoken / formats/scss/src / toScss

Funkcija: toScss()

toScss(tokens, options?): string

Eksperimentalno

Generiraj SCSS spremenljivke za token IR.

Parametri

tokens

readonly Token[]

IR (npr. iz @pantoken/tokens).

options?

ToScssOptions = {}

ToScssOptions.

Vrne

string

SCSS izvorni niz.

Primeri

Izpiši privzete (svetle) spremenljivke

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

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

Razreši temni način druge teme

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

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