Skip to content

pantoken / formats/scss/src / toScss

Función: toScss()

toScss(tokens, options?): string

Experimental

Emitir variables SCSS para una IR de tokens.

Parámetros

tokens

solo lectura Token[]

El IR (p. ej. de @pantoken/tokens).

options?

ToScssOptions = {}

ToScssOptions.

Devuelve

string

La cadena fuente SCSS.

Ejemplos

Emitir las variables predeterminadas (claro)

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

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

Resolver el modo oscuro de otro tema

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

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