Design token source and build pipeline for ATCHA.
- Source tokens live in
tokens/. - Tokens are compiled with Style Dictionary.
- Build outputs are generated in
build/:build/css/tokens.cssbuild/js/tokens.js
tokens/
├── primitive/
│ ├── color/
│ ├── spacing.json
│ ├── size.json
│ ├── radius.json
│ ├── icongraphy.json
│ └── typography/
│ ├── font-family.json
│ ├── font-weight.json
│ ├── font-size.json
│ └── line-height.json
├── semantic/
│ ├── color/
│ ├── space/
│ ├── size.json
│ └── typography/
└── component/
├── button/
├── badge/
└── label/
npm installnpm run build:tokensBuild pipeline:
style-dictionary build --config style-dictionary.config.jsscripts/generate-nested-tokens.js- converts raw JS output into nested token object export
- normalizes CSS units (
rem->px) - normalizes
font-sizeCSS variables topxwhen unitless - removes intermediate
build/js/tokens.raw.js
- CSS tokens are exposed as custom properties in
:root. - JS tokens are exported as a nested object:
import tokens from "./build/js/tokens.js";
const primaryText = tokens.text.primary;
const space16 = tokens.spacing["16"];build/js/tokens.raw.jsis intentionally ignored and deleted after each build.- If you change token paths, keep alias references (
{...}) consistent with actual token keys.