A color called teal-700 tells you what it looks like. A role called on-brand tells you what it’s for, and only the second one survives a new palette. Lumen components reference roles exclusively, and Lumen 5.0.0, released on November 7, put that to work: the same components now render under the default palette and the new Paper and Field themes, in light and dark, on the web and in native apps, without a component change.
Lumen’s palette has 17 roles. Surfaces form a stack: canvas is the page, surface is a component, and surface-muted and surface-strong add quieter and stronger emphasis. line draws borders and dividers. Text comes in ink, ink-soft, and ink-muted. brand, brand-solid, and brand-soft carry the action color, accent handles secondary emphasis, and success, warning, and danger carry status. Two more roles make the system work: on-brand and on-danger, the foregrounds that sit on filled actions.
Each role is stored as HSL channels, such as 192 72% 24%, and components wrap it in hsl(). Alpha composes without extra tokens: hsl(var(--surface) / 0.96) is a translucent surface in any theme.
.billing-notice {
background: hsl(var(--surface-muted));
border: 1px solid hsl(var(--line));
color: hsl(var(--ink));
}
.billing-notice__cancel {
background: hsl(var(--danger));
color: hsl(var(--on-danger));
}Nothing in that CSS knows which theme is active, and nothing needs to.
A color is never readable on its own; it’s readable on something. WCAG 1.4.3 Contrast (Minimum) asks for 4.5:1 for normal text and 3:1 for large text, and that ratio belongs to a pair. The on-* roles exist because the right foreground depends on the fill.
on-danger shows it best. In the default light palette, danger is a bright red, #EF4343. White text on it measures about 3.8:1, below the threshold, so on-danger is black, at about 5.5:1. Paper’s light danger is a deep red, #A11E17, where white reaches about 7.7:1 and black would fall to 2.7:1, so Paper’s on-danger is white. Same role, opposite answers, and the cancel button above is correct in both.
Lumen 5.0.0 fixed a real case of this. In Lumen 4, the default Badge drew white text on brand-solid. That worked on the default fills, but Paper’s dark brand-solid is a light rose, where white text measures about 2.1:1. The badge now uses on-brand, about 7.7:1 on the same fill, and an axe color-contrast test cycles it through the Studio, Paper, and Field presets in both schemes.
The same reasoning splits brand from brand-solid. brand is a foreground: links, focus rings, and text on brand-soft. brand-solid is a fill under on-brand. In dark mode they move in opposite directions. The default brand goes from #0E6077 to a pale #90D9E0 so links stay readable on dark surfaces, while brand-solid stays a mid-dark fill under white text. One token couldn’t do both jobs.
Lumen doesn’t invert colors or filter them for dark mode. Every role gets a dark value chosen for its job, and the names describe emphasis rather than lightness. In light mode, surface-strong is darker than canvas; in dark mode it’s lighter. Either way, it stands further from the page.
On the web, the scheme comes from data-theme="lumen-light" or "lumen-dark" on the root. A preset follows the nearest light or dark boundary, and data-lumen-scheme pins a section, which is how a light preview sits inside a dark page. Two practical notes. A dialog or menu rendered through a portal inherits CSS from its DOM parent, so mount it inside the themed boundary. And, as the 5.0 migration guide recommends, store the visitor’s light or dark preference separately from the theme identifier.
Paper and Field are the reading themes that shipped with 5.0.0. Paper pairs warm ivory surfaces with burgundy actions and serif headings in Prose and Typography; in dark mode it uses espresso surfaces and a rose action. Field uses sage surfaces, pine actions, and rounded controls, with deep green surfaces and a pale green action in dark mode. Each defines the same roles plus three radii and a serif-heading flag. Neither adds a component.
On the web, import the stylesheet from your adapter and set the preset on any boundary:
---
import { Button, Card } from '@santi020k/lumen-astro'
import '@santi020k/lumen-astro/styles/themes/paper.css'
---
<article data-lumen-preset="paper">
<Card>
<h2>Field notes</h2>
<Button>Save draft</Button>
</Card>
</article>The mobile adapters expose the same themes by name, scoped to a subtree:
ArticleView()
.lumenThemeScope(.paper)LumenThemeScope(theme = LumenNamedThemes.Field) {
ArticleScreen()
}React Native uses LumenThemeScope with paperTheme or fieldTheme from the matching themes/ entry. A nested scope follows its parent’s scheme unless you pin one.
All of this starts in one file, tokens/lumen.tokens.json, published as @santi020k/lumen-tokens. It uses Design Tokens Community Group token types. Each semantic color carries a hex $value for native platforms and its HSL channels for CSS, and the Paper and Field palettes live in the same document under a Lumen extension.
pnpm run generate:platform-tokens turns that document into TypeScript for Core and React Native, SwiftUI and WidgetKit sources, Compose sources, the Paper and Field stylesheet blocks, and the named native themes. It rejects a reading theme with a malformed color, a negative radius, or a separately set brand, which is derived from brand-solid. It also fails if the hand-written light and dark blocks in the shared stylesheet disagree with the canonical values. Its --check mode runs during validation and fails on any stale generated file, so a palette change can’t reach the web and quietly miss Android.
Core’s unit tests check the default palette as a matrix, in light and dark. Each text role (ink, ink-soft, ink-muted, brand, and accent) must reach 4.5:1 on each of the four surfaces, as must brand on brand-soft, on-brand on brand-solid, and on-danger on danger. The tightest of those pairs in light mode is ink-muted on surface-strong, at about 4.6:1. Margins that thin are why the test exists.
The reading themes get their own test. For Paper, Field, and the santi020k theme in both schemes, it checks ink on canvas, surface, and surface-muted, soft and muted ink on surface, every filled action’s foreground, and status colors used as text. It computes the ratios after converting HSL to the 8-bit colors native platforms receive, so rounding can’t push a pair under the line.
For your own theme, Core exports the same kind of audit:
import { inspectLumenTheme } from '@santi020k/lumen-core'
const scope = document.querySelector('[data-lumen-preset="river-press"]')
if (scope) {
const { findings, healthy } = inspectLumenTheme(scope)
if (!healthy) console.table(findings)
}inspectLumenTheme reads the computed roles from an element, and auditLumenTheme takes a token object. Both report missing roles, colors that aren’t resolved HSL channels, and core pairs below 4.5:1. Neither falls back to the default palette, so a role you forgot to map fails instead of borrowing a value. Run it once per light, dark, and nested scope. To choose colors visually, the theme playground previews real components in both schemes and exports CSS, Figma variables, or JSON, and the web theme guide covers mixing themes on one page.
Start with the pairs, not the swatches: ink on canvas and surface, on-brand on brand-solid, on-danger on danger. Define both schemes, run inspectLumenTheme in each, and try Paper on a single article page before committing a whole product to it. The components won’t need to know.







