Skip to content

pantoken / formats/scss/src / toScss

Funktion: toScss()

toScss(tokens, options?): string

Experimentell

SCSS-Variablen für ein Token-IR ausgeben.

Parameter

tokens

readonly Token[]

Das IR (z. B. von @pantoken/tokens).

options?

ToScssOptions = {}

ToScssOptions.

Rückgabe

string

Die SCSS-Quellzeichenfolge.

Beispiele

Standard-(helle) Variablen ausgeben

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

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

Löse den Dunkelmodus eines anderen Themas auf

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

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