Style Dictionary is an open-source build tool that transforms shared design tokens into files for applications to consume. A build can produce CSS custom properties for the web and different outputs for other platforms from the same source definitions.
How does a Style Dictionary build work?
Choose the source files, configure a platform, then specify how tokens should be transformed and written. A transform can change a token’s name or value for the target. A format decides how the result appears in a file. A transform group gives a platform a reusable set of transforms.
Example of building CSS variables
Put one DTCG number token in tokens.json:
{
"opacity": {
"muted": { "$type": "number", "$value": 0.6 }
}
}
Save the following as config.json. It converts token paths to kebab-case names and uses the built-in CSS variable format.
{
"source": ["tokens.json"],
"platforms": {
"css": {
"transforms": ["name/kebab"],
"buildPath": "dist/",
"files": [
{ "destination": "tokens.css", "format": "css/variables" }
]
}
}
}
With Style Dictionary installed, run npx style-dictionary build from the directory containing both files. The expected output is --opacity-muted: 0.6; under :root in dist/tokens.css. An application can load that file and use the property where the design calls for that opacity.
How do themes and aliases affect the build?
Decide which token values apply to each theme before generating its output. You might build one file per theme or emit variables under different CSS selectors. With css/variables, the outputReferences option can preserve eligible aliases as CSS variable references. Check that the referenced properties exist in the output the application loads.
Style Dictionary supports DTCG inputs. Its documentation identifies DTCG 2025.10 support as incomplete. Check the version you use against the types, references, and theme behavior your project needs. Run the build on a small fixture, inspect the output, and load it in one consuming component before bringing over the full token set.