Style Dictionary
An open-source build tool that reads design token files and generates code for each platform, such as CSS, TypeScript, Swift and Android resources.
In more detail
You configure platforms, and for each platform a list of transforms and a formatter. Style Dictionary reads the token JSON, runs every token through the transforms, then hands the whole set to the formatter, which writes the output file. Running it in continuous integration keeps every platform in step with the token source.
Related terms
- token transform — A Style Dictionary step that changes one token at a time, such as converting 16px to 1rem or renaming a token to camelCase.
- token formatter — A Style Dictionary step that takes all transformed tokens at once and writes them out as one file in a target language.
- 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.
- 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.
Taught in
- Token Transformation: Style Dictionary & Multi-Platform Outputs — Design Systems & Component Engineering