Skip to content

pantoken / formats/less/src / toLess

دالة: toLess()

toLess(tokens, options?): string

تجريبي

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

المعلمات

tokens

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

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

options?

ToLessOptions = {}

ToLessOptions.

القيم المرجعة

string

سلسلة مصدر Less.

أمثلة

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

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" });