$value and $type
The two reserved keys in the design token format: $value holds the token's value and $type says what kind of value it is.
In more detail
Examples of $type are color, dimension and duration, which lets tools check and convert values correctly. The dollar sign marks the keys as reserved, so they cannot be confused with the names of token groups. A $value may be a literal such as #3b82f6 or an alias such as {global.blue.500}.
Example
"global.blue.500": { "$value": "#3b82f6", "$type": "color" }Related terms
- Design Tokens Community Group — The W3C community group that writes a shared JSON format for design tokens so design tools and code tools can exchange them.
- token alias — A token whose value is a reference to another token, written in curly braces such as {semantic.action.bg}.
- design token — A named design decision, such as a colour, font size or spacing value, stored as data so every platform can use the same value.
Taught in
- Design Tokens: W3C Specs, Global, Semantic & Component Tokens — Design Systems & Component Engineering