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.
API
Paramètres
Paramètres d'entrée acceptés par cet util.
- treerequisISemanticTree
- The nested token tree (string/number leaves, object branches). Each leaf path becomes a CSS variable name.
- rootPathrequisReadonlyArray<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