Skip to content

pantoken-root / formats/less/src / toLess

Fall: toLess() ​

toLess(tokens, options?): string

Tilrauna

Gefðu út Less-breytur fyrir token IR.

Færibreytur ​

tokens ​

aðeins til lestrar Token[]

IR-ið (t.d. frá @pantoken/tokens).

options? ​

ToLessOptions = {}

ToLessOptions.

Skilar ​

string

Less upprunastrengurinn.

Dæmi ​

Gefðu út sjálfgefnu (ljósu) breyturnar

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

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

Leysa dökka stillingu annars þema

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

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