0Pricing
React Academy · Lesson

Multi-Theme and Multi-Brand Token Architecture

Structure tokens with tier hierarchy (primitive, semantic, component) to support light/dark and multiple brand themes.

Multi-Theme and Multi-Brand Token Architecture is a free React Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the React Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Theme vs Brand

A theme changes the color mode of the same brand (light and dark versions of the same product). A brand is a different visual identity — the same design system components rendered with different colors, typography, and spacing to serve different products or customers. Both use the same token architecture but at different abstraction levels.

Primitive Token Layer

Primitive tokens are the complete palette of raw values available to the system. They include every color step (color-blue-50 through color-blue-900), every spacing unit, every font size. Primitive tokens are never used directly in components — they are only referenced by semantic tokens. The palette is defined once and shared across all themes and brands.

Semantic Token Layer

Semantic tokens express intent: color-background-page, color-text-primary, color-action-primary. Each semantic token references a primitive token value appropriate for the current theme. Components are built against semantic tokens exclusively. This is the layer where theming happens.

Light Theme Semantic Mappings

In the light theme: color-background-page references color-white, color-text-primary references color-gray-900, color-action-primary references color-blue-500. These mappings are defined in a theme-specific token file that overrides the semantic layer for the light context.

Dark Theme Semantic Mappings

In the dark theme: color-background-page references color-gray-950, color-text-primary references color-gray-50, color-action-primary references color-blue-400 (slightly lighter for contrast on dark backgrounds). Only the semantic mappings change — the primitive palette and all components remain unchanged.

Brand Overrides

Brand A uses blue as primary (color-action-primary: {color-blue-500}). Brand B uses green (color-action-primary: {color-green-500}). The button component reads var(--color-action-primary) — it is completely unaware of which brand is active. Brand overrides only change semantic token mappings, never component code.

Runtime Theme Switching

CSS custom properties make runtime theme switching trivial. Store the current theme in a data attribute: document.documentElement.setAttribute('data-theme', 'dark'). CSS rules override semantic tokens under [data-theme="dark"]. The browser resolves all var() references to the new values immediately — zero JavaScript re-rendering required.

Build-Time Brand Theming

For different brands served as separate deployments, use build-time theming: generate separate CSS token files per brand with Style Dictionary, and load the correct brand CSS at application startup. This approach is appropriate when the brand is determined at deploy time (different domains, subdomains, or whitelabel instances), not at user interaction time.

Combining Brand and Theme

A multi-brand, multi-theme system requires a two-dimensional matrix: Brand A Light, Brand A Dark, Brand B Light, Brand B Dark. CSS custom properties handle this elegantly with nested selectors: [data-brand="a"][data-theme="dark"] overrides semantic tokens for that specific combination. Four combinations are four CSS blocks, not four codebases.

Token Versioning and Deprecation

As the design system evolves, tokens are added, renamed, or removed. Version control tokens in the same repository as code. When deprecating a token, keep the old name as an alias pointing to the new name for one release cycle, add a deprecation comment, and update consuming code. Coordinate token changes across design and engineering through a structured changelog.

Token Governance: Who Owns Tokens

Governance defines who can add or change tokens and what review process is required. Primitive tokens require design team approval. Semantic tokens require both design and engineering review. Component tokens can be managed by the component owner. Without this governance, duplicate tokens emerge and the "single source of truth" guarantee breaks down.

Semantic vs Primitive Token Distinction

Why should components reference semantic tokens instead of primitive tokens?

Lesson Recap

Themes change color modes within a brand; brands are different visual identities. Primitive tokens are the raw palette, semantic tokens express meaning and enable theming. Components use only semantic tokens. Dark mode and brand overrides change only semantic token mappings — components are unchanged. Runtime theming uses CSS custom properties with [data-theme] selectors; build-time branding generates separate CSS per brand. Token governance and versioning keep the system consistent as it evolves.

Frequently asked questions

Is the “Multi-Theme and Multi-Brand Token Architecture” lesson free?

Yes — the full text of “Multi-Theme and Multi-Brand Token Architecture” is free to read here on the web, and the React Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the React Academy course, upgrade to CoddyKit PRO.

What will I learn in “Multi-Theme and Multi-Brand Token Architecture”?

Structure tokens with tier hierarchy (primitive, semantic, component) to support light/dark and multiple brand themes. You practise React Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start React Academy?

No prior experience is required. React Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Multi-Theme and Multi-Brand Token Architecture” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this React Academy lesson?

Yes. Every React Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. What Are Design Tokens and Why They Matter
  2. Style Dictionary: Transforming and Generating Tokens
  3. Tokens in Tailwind, CSS Variables, and CSS-in-JS
  4. Multi-Theme and Multi-Brand Token Architecture
← Back to React Academy