Skip to main content
OlonJS drives all visual styling through a design token system defined in src/data/config/theme.json. Changing a token updates every component that uses it — including both dark mode (the default) and light mode. You never need to touch a CSS file or a component to retheme your site.
public/config/site.json is auto-generated by the build step. Always edit src/data/config/theme.json — changes to the public/ file will be overwritten the next time you run npm run build.

The theme.json file

The theme file has a name field and a tokens object that groups all design decisions:
src/data/config/theme.json

Color tokens

OlonJS uses semantic color naming — each token name describes the role, not the literal hue. This means you can swap the entire palette by editing tokens.colors without hunting for hardcoded hex values inside components. The Inkwell theme also defines extended tokens like card, elevated, overlay, ring, primary-light, primary-dark, and *-foreground variants for each semantic color. You can add as many tokens as your design system needs.

Updating a color

To change the brand color, edit the primary token in tokens.colors:
Before
After
Then rebuild to apply the change everywhere:
Because every component references var(--color-primary) rather than a hardcoded value, the update propagates across all buttons, links, chips, and highlighted text in one edit.

Light mode override

tokens.modes.light.colors overrides any base token when the visitor’s theme is set to light. The default mode is dark; light mode is activated when document.documentElement.dataset.theme === 'light'. The light palette in Inkwell replaces every color token with a lighter counterpart:
src/data/config/theme.json (excerpt)
You only need to list the tokens you want to override — any token not listed in modes.light.colors falls back to its base value.
To switch a user’s theme at runtime, toggle document.documentElement.dataset.theme between 'light' and '' (or 'dark'). OlonJS picks up the change via CSS attribute selectors without a page reload.

Typography tokens

Control font families for body text, code, display headings, and the site wordmark:
src/data/config/theme.json (excerpt)
To swap fonts, replace the font-family strings and add the corresponding @import or <link> to your Next.js layout.

Spacing and border radius

Spacing tokens

These control macro layout dimensions shared across all sections:

Border radius tokens

Adjust these tokens to shift the overall “roundness” of the UI — for example, setting all values to 0 produces a sharp, editorial look, while larger values create a softer, app-like feel.