Skip to content

pantoken / formats/scss/src / toScss

함수: toScss()

toScss(tokens, options?): string

실험적

토큰 IR에 대한 SCSS 변수를 내보냅니다.

매개변수

tokens

읽기 전용 Token[]

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

options?

ToScssOptions = {}

ToScssOptions.

반환값

string

SCSS 소스 문자열입니다.

예제들

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

ts
import { toScss } from "@pantoken/scss";
import { tokens } from "@pantoken/tokens";

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

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

ts
import { toScss } from "@pantoken/scss";
import { byTheme } from "@pantoken/tokens";

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