Guides
Token tiers
Flint has three tiers. Each points at the one below it, so a change at the bottom flows everywhere above it, and nothing above can drift.
The three tiers
| Tier | Example | Use it for |
|---|---|---|
| Primitive | color.blue.700, space.16, radius.sm | Nothing in UI. Primitives only feed the tiers above. |
| Semantic | text.link points at color.blue.700 | Colors and roles in UI: surfaces, text, borders, feedback, charts. |
| Component | button.primary.bg points at semantic.action.primary | The decisions a component makes, shared by MUI, shadcn, CSS and SwiftUI. |
References
Semantic colors exist twice, once per mode, and each points at a ladder step. Component tokens point at a semantic token without naming a mode, so they follow light and dark on their own. The build resolves every reference and fails on one that points nowhere.
tokens.json "semantic": {
"light": { "text": { "link": "{color.blue.700}" } },
"dark": { "text": { "link": "{color.blue.300}" } }
},
"component": {
"button": { "primary": { "bg": "{semantic.action.primary}" } }
}
One token, every name
Figma CSS JS Swift text/link--color-text-linksemantic.light.text.linkFlint.Colors.textLink feedback/success/text--color-feedback-success-textsemantic.light.feedback.success.textFlint.Colors.feedbackSuccessText button/primary/bg--button-primary-bgcomponent.light.button.primary.bgFlint.Component.buttonPrimaryBg
Figma uses slashes, CSS uses kebab-case with a prefix, JS keeps the path, Swift joins the path in camelCase.
Adding or changing a token
- Edit
tokens.json. Point at an existing token with a reference wherever you can. - Run
npm run build. It rebuilds every output, then runs the contrast, usage and parity checks. - Check the result in these docs and in the workbench, light and dark.
- Bump the version: a new token is a minor, a value fix is a patch, a rename or removal is a major.