Skip to content

pantoken / formats/less/src / toLess

Funktion: toLess()

toLess(tokens, options?): string

Eksperimentel

Udsend Less-variabler for en token IR.

Parametre

tokens

skrivbeskyttet Token[]

IR'en (f.eks. fra @pantoken/tokens).

options?

ToLessOptions = {}

ToLessOptions.

Returnerer

string

Less-kildestrengen.

Eksempler

Udsend standardvariabler (light)

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

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

Løs mørk tilstand for et andet tema

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

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