Skip to content

pantoken-root / formats/scss/src / toScss

Funksjon: toScss() ​

toScss(tokens, options?): string

Eksperimentell

Generer SCSS-variabler for en token-IR.

Parametere ​

tokens ​

skrivbeskyttet Token[]

IR-en (f.eks. fra @pantoken/tokens).

options? ​

ToScssOptions = {}

ToScssOptions.

Returnerer ​

string

SCSS-kildestrengen.

Eksempler ​

Generer de standard (lyse) variablene

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

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

Bestem mørk modus for et annet tema

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

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