1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! 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.
/// The scheme prefix stripped when naming a CSS variable (`dark.color.primary`
/// overrides the same `--pl-color-primary` inside a dark media query).
pub const DARK_PREFIX: &str = "dark.";
/// The CSS custom-property prefix for every token variable.
pub const VAR_PREFIX: &str = "--pl-";
/// The generative spacing family: `space.<N>` resolves to
/// `calc(var(--pl-space-base) * N)`.
pub const SPACE_FAMILY: &str = "space.";
/// 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.
pub const LENGTH_PREFIXES: & = &;
/// Prefix/suffix length rules: a path matching `prefix…suffix` is a length.
pub const LENGTH_PREFIX_SUFFIX: & = &;
/// Exact-length token paths.
pub const LENGTH_EXACT: & = &;
/// `elevation.<low|high>.<component>`: these suffixes are lengths.
pub const LENGTH_ELEVATION_SUFFIXES: & = &;
/// Characters preserved verbatim in a CSS variable name; every other character
/// maps to `-`. (ASCII alphanumerics plus `-` and `_`.)
pub const VAR_NAME_PRESERVED: &str = "alphanumeric, '-', '_'";