Skip to content

pantoken / formats/less/src / toLess

Feidhm: toLess()

toLess(tokens, options?): string

Turgnamhach

Scaoil athróga Less do token IR.

Paraiméadair

tokens

neamh-inathraitheach Token[]

An IR (m.sh. ó @pantoken/tokens).

options?

ToLessOptions = {}

ToLessOptions.

Tuairisceáin

string

An tsreang fhoinsí Less.

Samplaí

Scaoil na hathróga réamhshocraithe (éadrom)

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

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

Réitigh mód dorcha téama eile

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

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