The W3C reference architecture
The W3C Design Tokens Community Group defines a four-layer reference architecture for design token systems. Underlith implements the third layer — and provides the tooling to complete the pipeline.
- 01 Design tools — Design intent defined in Figma, Tokens Studio, or similar tools (Definition)
- 02 Pipeline — Raw data processed, aliases resolved, outputs normalized (Transformation)
- 03 Underlith +
@your-org/tokens— Base tokens, brand layer, semantic aliases — versioned and publishable (Source of Truth) - 04 Applications — Plain CSS, Tailwind, Sass, CSS-in-JS — tokens consumed, not redefined (Consumption)
Underlith implements the Token Source of Truth layer. @your-org/tokens — generated by underlith brand init — is the published artifact that your org's products consume.
1. Design tools define intent
W3C: Design Token Definition Layer
The W3C defines a design token as a named entity that stores visual design attributes. Design tools are used only as the definition layer — they define intent and semantics, not implementation.
Applied principles
- Tokens represent design decisions, not technical details
- Semantic naming, independent of platform or framework
- Tokens may contain primitive values or references and aliases
Conceptual example
{
"color": {
"brand": {
"primary": {
"value": "#0055FF",
"type": "color"
}
}
}
}Neutral, declarative, and decoupled from runtime concerns — as defined by the W3C.
2. Pipeline transforms
W3C: Token Processing & Transformation
The W3C recommends that tokens remain independent from how they are consumed. Transformation is an explicit intermediate step.
Pipeline responsibilities
- Resolve aliases and references
- Normalize naming and hierarchies
- Convert tokens to target formats (CSS, JSON)
- Separate base tokens from brand tokens
Example outputs
underlith.tokens.css— all tokens as CSS Custom Propertiesunderlith.tokens.json— tokens in JSON for tools and agents (roadmap)- Framework mappings (Tailwind
@theme, Sass variables)
3. Underlith implements the source layer
W3C: Token Source of Truth
Underlith provides the base token infrastructure — the stable, versioned, framework-agnostic foundation that any product can build on. The W3C requires this layer to be independent from any specific platform or runtime.
On top of Underlith, underlith brand init generates your org's brand package — @your-org/tokens — which is the published artifact your products actually consume.
Underlith responsibilities
- Define and maintain base token scales (space, type, radius, motion, elevation)
- Provide CLI tooling to extract and package brand decisions
- Enable versioning, auditing, and traceability
- Remain framework and platform agnostic
Structure
@mikaelcarrara/underlith ← base token infrastructure
└── src/tokens/
├── underlith.tokens.css
├── spacing.css
├── colors.css
├── motion.css
└── semantic-aliases.css
@your-org/tokens ← your brand layer (generated)
├── your-org.brand.css
└── your-org.base.css4. Applications consume
W3C: Token Consumption Layer
At this stage, tokens are consumed — not redefined. The W3C states that tokens should be applied according to platform needs without altering their meaning.
Examples
.card {
padding: var(--ul-space-4);
background: var(--ul-color-bg-surface);
border-radius: var(--ul-radius-md);
}/* Tailwind v4 */
@theme {
--color-brand: var(--ul-color-brand-primary);
--radius-md: var(--ul-radius-md);
}Applied principles
- Applications depend on tokens — tokens remain platform-agnostic
- Design changes do not require structural refactors
- The semantic contract remains intact across framework migrations
Summary
Underlith follows the reference architecture defined by the W3C Design Tokens Community Group:
| W3C layer | Implementation |
|---|---|
| Token Definition | Design tools (Figma, Tokens Studio) |
| Token Transformation | Pipeline (underlith brand init) |
| Token Source of Truth | Underlith + @your-org/tokens |
| Token Consumption | Plain CSS, Tailwind, Sass, CSS-in-JS |
Underlith is a semantic foundation aligned with the W3C and designed for long-term evolution. The implementation is yours. The infrastructure is shared.
W3C Spec Status
Design Tokens Format Module — W3C Design Tokens Community Group · 2025.10 View spec →
- Translation tool — The W3C defines translation tools as tools that convert token data between formats.
underlith brand initis a translation tool — it readsunderlith.tokens.cssand outputs a publishable@your-org/tokenspackage. Aligned - JSON format — The spec defines JSON as the canonical interchange format for design tokens.
underlith.tokens.jsonis on the roadmap — completing the pipeline to Figma sync, Style Dictionary, and mobile platforms. Roadmap - Spec status — The Design Tokens Format Module is a Community Group draft — not yet a W3C Standard. Underlith tracks the spec closely and will update as it evolves toward official status. Draft