Skip to content

pantoken / formats/less/src / toLess

Fonksiyon: toLess()

toLess(tokens, options?): string

Deneysel

Bir token IR için Less değişkenleri üret.

Parametreler

tokens

salt okunur Token[]

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

options?

ToLessOptions = {}

ToLessOptions.

Döndürür

string

Less kaynak dizesi.

Örnekler

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

ts
import { toLess } from "@pantoken/less";
import { tokens } from "@pantoken/tokens";

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

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

ts
import { toLess } from "@pantoken/less";
import { byTheme } from "@pantoken/tokens";

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