Style once, use everywhere.
open sourceApache-2.0self-hostablefree
Style Dictionary is a build system for design tokens: you define colours, sizes, fonts and other values once in JSON, and it transforms and exports them to every platform, such as CSS variables, SCSS, Less and Stylus variables, Android resources, Jetpack Compose, iOS Swift and Objective-C, Flutter, JavaScript and TypeScript modules, Sketch palettes and style documentation. It is forward-compatible with the Design Tokens Community Group format. Custom transforms and formats extend it, and it runs as a CLI, as a Node module, and since version 4 natively in browsers. Amazon started it, and Tokens Studio has co-maintained it since 2023.
Ways to install
Package managers
Problems it solves
- our brand colours are defined separately in CSS, iOS and Android and keep drifting apart
- export design tokens from one JSON file to CSS variables, Swift and Android XML
- generate SCSS variables and a TypeScript module from the same colour palette
- turn the tokens our designers export from Figma into code for every platform
- keep a design system's spacing, typography and colour values in one source of truth
- convert our token files to the W3C design tokens community group format
- add a custom output format for our own platform from shared design values
- support several brands and themes from one set of design tokens
- rebuild platform style files automatically in CI when a token changes
- transform colour values to the format each platform expects, like hex for web and UIColor for iOS
Features
- forward-compatible with the Design Tokens Community Group format
- CSS variables, SCSS, Less and Stylus outputs
- Android resources and Jetpack Compose objects
- iOS Swift and Objective-C outputs
- Flutter Dart class output
- JavaScript, ES module and TypeScript declaration outputs
- Sketch palettes and JSON outputs
- custom transforms and formats
- CLI (style-dictionary build) and Node module
- runs natively in browsers
Capabilities
| Has an API | plan not known |
|---|---|
| Has a command line tool | plan not known |
| Takes plugins | plan not known |
Alternatives
The same job
These do what Style Dictionary does.
- Open Props Expertly crafted web design tokens
