semanticTreeToVars

Theme
stable

Walk a hand-authored semantic token tree depth-first and emit a flat map of CSS custom property names to their leaf values, prefixed with a given root path.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

tree
requis
ISemanticTree
The nested token tree (string/number leaves, object branches). Each leaf path becomes a CSS variable name.
rootPath
requis
ReadonlyArray<string>
The prefix path segments to prepend before each leaf path when building the CSS variable name.

API

Valeur de retour

La valeur retournée par cet util.

A flat Record<string, string | number> mapping each "--origam-*" CSS variable to its token value.

Usage

Exemples

Extraits de code prêts à coller.

Flatten a color subtree

typescript