mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
@hanzo/tokens
The single source of truth for the Hanzo design tokens — colours, radius, type, spacing — for every surface. React reads the TypeScript; non-React surfaces (a Gitea fork, a Go dashboard, an Argo CD fork) embed the generated CSS. One edit propagates everywhere.
Hanzo is monochrome: one hue through an opacity ladder, dark by default. The only
permitted non-mono values are the three status hues (--state-error,
--state-online, --state-success). Type is Geist + Geist Mono, self-hosted.
The pipeline
src/theme.ts ──gen-css──▶ dist/colors.css ──▶ @hanzo/design/tokens/colors.css ──▶ styles.css
(the source) dist/tokens.css ──▶ @hanzo/brand/styles/variables.css ──▶ git/ci/cd
src/theme.tsholds every colour token (dark→:root,light→.light) plus the radius/type/spacingscale. Values are raw CSS strings, so avar()reference stays a reference and the emitted bundle is what consumers already ship. This is the ONE place to edit a value.scripts/gen-css.mjsreads the builtdist/theme.mjsand emits:dist/colors.css— the colour tokens only (@hanzo/tokens/css/colors); the contract@hanzo/designrepublishes.dist/tokens.css— colours + radius + type + spacing (@hanzo/tokens/css); what@hanzo/brandre-emits for Go surfaces.
themes.ts/colors.tsare the resolved, flat views for JavaScript consumers that cannot dereferencevar(). They mirrortheme.ts.
Regenerate
pnpm --filter @hanzo/tokens gen-css
Flow: edit src/theme.ts → gen-css → @hanzo/design and @hanzo/brand pull
the generated CSS on their next gen/build → git / ci / cd pick it up. gen-css
runs as part of build (and prepublish), so a published package always ships
current CSS.