Enterprise Multi-Brand
The Scenario
Section titled “The Scenario”2 brands × 2 themes × 2 densities × 4 platforms = many permutations. Enterprise token systems need to scale across brands, themes, and platforms without combinatorial duplication.
Resolver Structure
Section titled “Resolver Structure”Organize your resolver with sets for base tokens and modifiers for brand, theme, and density:
{ "version": "2025.10", "sets": { "base": { "sources": [ { "$ref": "./tokens/base/colors.json" }, { "$ref": "./tokens/base/spacing.json" } ] }, "alias": { "sources": [{ "$ref": "./tokens/semantic/aliases.json" }] } }, "modifiers": { "brand": { "default": "acme", "contexts": { "acme": [{ "$ref": "./tokens/brands/acme.json" }], "globex": [{ "$ref": "./tokens/brands/globex.json" }] } }, "theme": { "default": "light", "contexts": { "light": [{ "$ref": "./tokens/themes/light.json" }], "dark": [{ "$ref": "./tokens/themes/dark.json" }] } } }, "resolutionOrder": [ { "$ref": "#/sets/base" }, { "$ref": "#/modifiers/brand" }, { "$ref": "#/modifiers/theme" }, { "$ref": "#/sets/alias" } ]}Explicit Permutations
Section titled “Explicit Permutations”Build only the permutations you need instead of the full cross-product:
await dispersa.build({ permutations: [ { brand: 'acme', theme: 'light' }, { brand: 'acme', theme: 'dark' }, ], outputs: [ css({ name: 'tokens', file: '{brand}/tokens-{theme}.css', preset: 'standalone', // ... }), ],})This produces acme/tokens-light.css and acme/tokens-dark.css without building globex or other combinations.
Dynamic File Naming with Multiple Modifiers
Section titled “Dynamic File Naming with Multiple Modifiers”Use placeholders for each modifier in the file path:
file: '{brand}/tokens-{theme}.css'Produces: acme/tokens-light.css, acme/tokens-dark.css, globex/tokens-light.css, etc.
- Keep base tokens brand-agnostic — shared spacing, typography, and structure
- Use semantic aliases —
color.background.primarythat brands override with concrete values - Resolution order matters — modifiers listed later override earlier ones
In-Memory Mode Run Dispersa entirely without the filesystem for APIs, testing, and serverless environments.