@apollion-dsi/tokens
@apollion-dsi/tokens builds the Apollion theme into static files — CSS custom properties, DTCG JSON,
TypeScript literals and a Tailwind preset — from a config file, with no React in the path. It runs the same
derivation as the runtime theme, so a seed produces the same values in both.Token Build
When to use
- Use when a non-React stack (Vue, Flutter, plain HTML) or design tooling needs the tokens.
- Use when static output — SSG pages, e-mail, reports — should link CSS variables instead of shipping React.
- Use when CI should fail on a stale token build (
--check). - Avoid when the app renders with
ApollionProvideronly: the runtime theme needs no build step.
How it works
- Declare brands and the variant axes in
apollion.config.mjswithdefineConfig. - Run
apollion-tokens build; each enabled output lands in the--outdirectory with amanifest.json. - Link or import the files from that directory.
yarn add --dev @apollion-dsi/tokens yarn apollion-tokens build --config apollion.config.mjs --out dist/tokens
The package version moves in lockstep with @apollion-dsi/core. Core lists tokens as an optional
dependency, and tokens takes core as a peer dependency for the shared derivation.
Stable entry points
Subpath | Contents |
|---|---|
@apollion-dsi/tokens/config-loader | defineConfig and the sandboxed loadConfig |
@apollion-dsi/tokens/config-schema | the ApollionConfig types and variant helpers |
@apollion-dsi/tokens/build | build() and check() as functions |
@apollion-dsi/tokens/runtime/v1 | the versioned runtime API |
Scrolls sideways inside the table. The page does not.
A breaking change to the runtime surface ships as runtime/v2; v1 stays available.