Skip to content

pantoken / formats/less/src / toLess

함수: toLess()

toLess(tokens, options?): string

실험적

토큰 IR을 위한 Less 변수를 생성합니다.

매개변수

tokens

읽기 전용 Token[]

IR(예: @pantoken/tokens에서 온 것).

options?

ToLessOptions = {}

ToLessOptions.

반환값

string

Less 소스 문자열입니다.

예제들

기본(라이트) 변수를 생성합니다

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

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

다른 테마의 다크 모드를 해결

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

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