Skip to content

Dispersa

A DTCG-native build system for design tokens. Resolve, transform, and render to any platform.

6 Output Formats

CSS custom properties, JSON, JS/TS modules, Tailwind CSS v4, Swift/SwiftUI, and Kotlin/Jetpack Compose — all built in.

Extensible Pipeline

Custom preprocessors, filters, transforms, and renderers. Build exactly the output your platform needs.

In-Memory Mode

Run without the filesystem for build tools, APIs, testing, and serverless environments.

Dispersa processes tokens through a pipeline:

Resolve → Preprocess → Parse → Global Filter → Global Transform → Filter → Transform → Render
CSSJSONJS...
Resolve

Loads the DTCG resolver document, merges sets in order, and applies modifier contexts (themes, platforms, densities) to produce the raw token tree for each permutation.

Input:Resolver document + modifier inputs
Output:Raw token tree per permutation

Define your tokens in DTCG format, configure a resolver document with sets and modifiers, then build output for every platform from a single source of truth.

import { Dispersa, css } from 'dispersa'
import { colorToHex, nameKebabCase } from 'dispersa/transforms'
const dispersa = new Dispersa({
resolver: './tokens.resolver.json',
buildPath: './dist',
})
await dispersa.build({
outputs: [
css({
name: 'css',
file: 'tokens.css',
preset: 'bundle',
transforms: [nameKebabCase(), colorToHex()],
}),
],
})