Skip to content

pantoken / formats/less/src / toLess

Funkcija: toLess()

toLess(tokens, options?): string

Eksperimentalno

Izpiši Less spremenljivke za token IR.

Parametri

tokens

readonly Token[]

IR (npr. iz @pantoken/tokens).

options?

ToLessOptions = {}

ToLessOptions.

Vrne

string

Izvorni niz Less.

Primeri

Izpiši privzete (svetle) spremenljivke

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

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

Razreši temni način druge teme

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

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