@halogen-ui/tokens
v0.2.0
Published
Halogen design tokens — OKLCH-derived, contrast-asserted, two-layer.
Maintainers
Readme
@halogen-ui/tokens
The token layer for Halogen. OKLCH-derived, contrast-asserted, and two-layer: primitives hold the values, semantics name the jobs, and only the semantic layer is addressable from a component.
pnpm add @halogen-ui/tokensWhat it exports
| Entry | What it is |
| --- | --- |
| @halogen-ui/tokens | typed const maps — semanticTokens, primitiveTokens, resolved |
| @halogen-ui/tokens/tokens.css | the custom properties, both themes |
| @halogen-ui/tokens/theme.css | maps them into Tailwind v4's namespaces |
| @halogen-ui/tokens/fonts.css | self-hosted Geist and Geist Mono |
| @halogen-ui/tokens/figma | Figma variables export |
| @halogen-ui/tokens/tokens-studio | Tokens Studio format |
| @halogen-ui/tokens/classgroups | tailwind-merge class groups for the custom namespaces |
@import '@halogen-ui/tokens/fonts.css';
@import '@halogen-ui/tokens/tokens.css';
@import 'tailwindcss';
@import '@halogen-ui/tokens/theme.css';The TypeScript entry types each token name as a union, not as string, so a
typo is a compile error at the call site:
import { semanticTokens, resolved } from '@halogen-ui/tokens';
semanticTokens['surface-raised']; // 'var(--halogen-surface-raised)'
resolved.dark['ink-primary']; // the resolved OKLCH valueContrast is asserted, not hoped for: every foreground/background pair the system permits is checked against WCAG at build time, and the build fails on a regression. See the repository for the report and the reasoning.
