tokenPathToCssVar

Theme
stable

Convenience wrapper around tokenPathToCssVarName that returns the full `--origam-…` CSS custom-property reference, ready to drop into a stylesheet declaration or `:style` binding.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

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

path
requis
ReadonlyArray<string>
The token path segments, e.g. `["btn", "primary", "background-color"]` for a component token or `["color", "neutral", "500"]` for a semantic/primitive token.
isComponent
requis
boolean
True for tokens from `tokens/component/*.json`; false for primitive or semantic tokens. Controls the separator rules (triple-tiret vs double-tiret vs `__` BEM child).

API

Valeur de retour

La valeur retournée par cet util.

The full CSS custom property reference including the leading `--`, e.g. `"--origam-btn--primary---background-color"`.

Usage

Exemples

Extraits de code prêts à coller.

Resolve component and semantic token paths

typescript