Skip to content

pantoken-root / formats/less/src / toLess

Swyddogaeth: toLess() ​

toLess(tokens, options?): string

Arbrofol

Allanoli newidiolion Less ar gyfer IR tocyn.

Paramedrau ​

tokens ​

darllen-yn-unig Token[]

Yr IR (er enghraifft o @pantoken/tokens).

options? ​

ToLessOptions = {}

ToLessOptions.

Yn dychwelyd ​

string

Y llinyn ffynhonnell Less.

Enghreifftiau ​

Allanoli'r newidiolion diofyn (golau)

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

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

Datrys modd tywyll ar gyfer thema arall

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

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