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

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

path
required
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
required
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

Return value

The value returned by this util.

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

Usage

Examples

Ready-to-paste usage snippets.

Resolve component and semantic token paths

typescript