Skip to content

pantoken-root / packages/core/src / resolveReferences

Fonksyon: resolveReferences() ​

resolveReferences(tokens, mode?): Map<string, string>

Beta

Rezoud chak token pou yon valè konkrè, yon sèl mòd: elaji chenn var(...) epi konprese light-dark() nan mode chwazi a.

Paramèt ​

tokens ​

sèlman lekti Token[]

IR la.

mode? ​

Mode = "light"

Ki bò light-dark() pou kenbe (defo "light").

Retounen ​

Map<string, string>

Yon map ki konekte non token ak valè konkrè.

Egzanp ​

Rezoud IR konpile a nan valè konkrè pou mòd fènwa

ts
import { buildTokens } from "@pantoken/core/build";
import { resolveReferences } from "@pantoken/core";

const resolved = resolveReferences(buildTokens(), "dark");
resolved.get("--instui-color-background-base"); // → a concrete "#…" value