Skip to content

pantoken / packages/core/src / resolveReferences

Feidhm: resolveReferences()

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

Béite

Réitigh gach token go luach concrét, aon-mhód amháin: leathnaigh slabhraí var(...) agus comhbhrúigh light-dark() go dtí an mode roghnaithe.

Paraiméadair

tokens

inléite Token[]

An IR.

mode?

Mode = "light"

Cén taobh de light-dark() atá le coimeád (réamhshocraithe "light").

Tuairisceáin

Map<string, string>

Mapa ainm an token go luach concrét.

Sampla

Réitigh an IR tógtha go luachanna concréite don mhód dorcha

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