Skip to main content

Module token_spec

Module token_spec 

Source
Expand description

Canonical design-token conventions (spec/TOKENS.md), shared with the TypeScript DOM client: the Rust renderer consumes these tables directly, and pathland-ts-codegen emits the TS equivalents from them — so the --pl-* naming, the dark. scheme prefix, the generative space.<N> family, and the length-token rules cannot drift between the renderers.

Constants§

DARK_PREFIX
The scheme prefix stripped when naming a CSS variable (dark.color.primary overrides the same --pl-color-primary inside a dark media query).
FORCED_DARK_VAR_PREFIX
Prefix for the explicit dark-value variable family. Every canonical token also exposes its dark-layer value at --pl-dark-<path> regardless of the active scheme, so a dark.-prefixed reference can force the dark value (spec/TOKENS.md).
LENGTH_ELEVATION_SUFFIXES
elevation.<low|high>.<component>: these suffixes are lengths.
LENGTH_EXACT
Exact-length token paths.
LENGTH_PREFIXES
Token paths whose F32 values are CSS lengths (emitted with px): the value renders with a px suffix when it matches any of these leading prefixes.
LENGTH_PREFIX_SUFFIX
Prefix/suffix length rules: a path matching prefix…suffix is a length.
SPACE_FAMILY
The generative spacing family: space.<N> resolves to calc(var(--pl-space-base) * N).
VAR_NAME_PRESERVED
Characters preserved verbatim in a CSS variable name; every other character maps to -. (ASCII alphanumerics plus - and _.)
VAR_PREFIX
The CSS custom-property prefix for every token variable.