Skip to content

pantoken / formats/less/src / toLess

Funktio: toLess()

toLess(tokens, options?): string

Kokeellinen

Tuota Less-muuttujia tokenin IR:lle.

Parametrit

tokens

vain-luku Token[]

IR (esim. peräisin @pantoken/tokens).

options?

ToLessOptions = {}

ToLessOptions.

Palauttaa

string

Less-lähdemerkkijono.

Esimerkit

Tuota oletus (vaaleat) muuttujat

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

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

Määritä toisen teeman tumma tila

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

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