Skip to content

pantoken-root / formats/scss/src / toScss

Fonksiyon: toScss() ​

toScss(tokens, options?): string

Deneysel

Bir token IR'si için SCSS değişkenleri oluştur.

Parametreler ​

tokens ​

salt okunur Token[]

IR (ör. @pantoken/tokens'den).

options? ​

ToScssOptions = {}

ToScssOptions.

Döndürür ​

string

SCSS kaynak dizesi.

Örnekler ​

Varsayılan (açık) değişkenleri oluştur

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

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

Başka bir temanın koyu modunu çözümle

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

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