References
Learn how to reference and reuse token values throughout your design system. References keep your tokens connected and your system maintainable.
Dollar References
Reference other tokens using the $ prefix. Arithmetic expressions work directly without needing calc().
Basic References
Change baseSpacing — watch others update.
Nested References
Reference nested tokens using dot notation:
Forward References
References are order-independent — you can reference tokens defined later in the file:
Ellipsis References
Use $... to reference tokens relative to the current scope. The ellipsis searches upward through parent scopes.
Collection Access
Access items from arrays and scales using bracket notation with 1-based ordinal indexing.
Single Items
Access by position (1-based). Negative indices count from the end.
Named Positions
Use semantic names instead of numbers:
Ranges
Extract subsets with inclusive ranges. Use a step value to skip items.
Predicates & Unions
Use [odd], [even] predicates or comma-separated lists to select multiple items.
Getting Keys
Use .key to get the token name instead of its value. Works with single access, ranges, and predicates.
Advanced Access
Combine ellipsis references with collection access, and use arithmetic in selectors.
Ellipsis + Collections
Use $... with bracket notation to access collections from parent scopes:
Arithmetic in Selectors
Use +, -, *, / inside brackets for dynamic indexing:
Indexing rules: All indexing is 1-based (ordinal). $items[0] is an error. Ranges are inclusive: [2..4] includes positions 2, 3, and 4. Single access is strict (errors if out of bounds),
range access is safe (clamped).
Next: Expressions — arithmetic, method chaining, interpolation, and color functions.