OverviewGetting startedInstallationComponentsFoundationsToken architectureColorTypographySpacingBorders and radiiElevationMotionThemesResponsive behaviorCore and stateTheming and layoutAgent toolingAI toolingChange impactRecipesArchitectureRoadmapHelp and releasesOverviewToken architectureColorTypographySpacingBorders and radiiElevationMotionThemesResponsive behavior

The token layers

Reference tokens (--odd-ref-*) hold the raw scale and palette. Semantic tokens (--odd-color-text-primary, --odd-space-md) name a purpose. Component tokens belong to their component and are normally unset, with a fallback. The validator rejects a reference the category does not allow, such as a foundation token that aliases a component role.

Tokens in the default theme, by category (233)
CategoryTokensExample
foundation67--odd-border-width-default
component7--odd-card-padding
semantic85--odd-color-accent-decorative
layout6--odd-layout-gap
reference68--odd-ref-brand-50

From configuration to CSS

Stages 1 to 7 are pure and live in @oddkin/tokens/generate, which also runs in the browser; file input and output and the command line live in @oddkin/tokens/node. Generation is deterministic: stable key order, fixed number formatting, and no timestamps.

The generator, stage by stage
StageInput → outputNotes
1. Load & validatefile / object → ThemeConfigSchema + semantic checks; diagnostics carry JSON-pointer paths
2. Resolve defaults & preset→ complete recipeDeep merge with documented rules (arrays replace, objects merge)
3. Generate scales & palettesrecipe → reference tokensPer-domain generators
4. Resolve aliasesreference + semantic + component definitions → graphDetect missing refs, cycles, tier violations
5. Composegraph × modes × products × density → scoped graphsComputes per-scope re-declaration sets (§5)
6. Context validationscoped graphs → diagnosticsContrast of real role pairs, unit validity per output, min target size under density
7. Emitgraphs → CSS, SCSS, DTCG JSON, TS types/refs/values, inspection metadata, reportPure functions; Node layer writes files

Trace a token

Roles alias the step they use, so a theme changes a step once and every role that reads it follows. card.padding reads a layout role, which reads the space scale:

card.padding, resolved through its aliases
TokenCategoryDefinitionValue
card.paddingcomponent{layout.inset}1.5rem
layout.insetlayout{space.lg}1.5rem
space.lgfoundation1.5rem1.5rem

Aliases and overrides

Configuration precedence: Oddkin defaults, then the preset, then the user configuration, then explicit overrides by stable token name. Each resolved token records its origin, so tools can label it generated, preset, configured, or overridden. Generated files are never edited by hand.

Every value on these pages comes from the default theme as @oddkin/tokens/inspect/default.json and @oddkin/tokens/inspect/default.contrast.json describe it. The theming and token pipeline design has the full rules.