Skip to content

pantoken-root / formats/less/src / toLess

دالة: toLess() ​

toLess(tokens, options?): string

Experimental

إخراج متغيرات Less لـ token IR.

Parameters ​

tokens ​

للقراءة فقط Token[]

IR (مثلاً من @pantoken/tokens).

options? ​

ToLessOptions = {}

ToLessOptions.

Returns ​

string

سلسلة مصدر Less.

Examples ​

إخراج المتغيرات الافتراضية (الفاتحة)

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

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

حل وضع السمة الداكنة لمظهر آخر

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

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