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.
In more detail
Transforms can change a token's value, its name or its attributes. They run in the order listed for a platform, before any formatter. Custom transforms adapt raw design-tool values to a codebase's conventions.
Related terms
- 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.
- token formatter — A Style Dictionary step that takes all transformed tokens at once and writes them out as one file in a target language.
- rem — A CSS length unit equal to the font size of the root html element, which is 16 pixels unless the user or page changes it.
- kebab-case, camelCase and snake_case — Ways of writing multi-word names without spaces: kebab-case uses hyphens, camelCase capitalises each later word, snake_case uses underscores.
Taught in
- Token Transformation: Style Dictionary & Multi-Platform Outputs — Design Systems & Component Engineering