Design tokens
Design tokens are the named values a user interface is built from: colours, type sizes, spacing, radii, shadows and animation lengths, kept in one place and used by name. A change to a token reaches every screen that uses it, in both themes. In Meadowstack the colour tokens are generated from two inputs, and a guard fails the build when code types a colour itself.
By Bohuslav PoláčekChecked
* 7 Nov 2026 (docs/decisions/0012-greyscale.md): back to pure grey, chroma 0, for the apps and the website alike.
* The warm tint read as cream in the apps and as beige on the site (Bob, 4 and 7 Nov 2026), and the second
* "neutral" palette that hid it on the website is gone: one greyscale everywhere.
*
* There is deliberately no accent or brand colour: the kit is neutrals,
* status colours and the categorical hues that carry identity and data
* (palette.ts). A client brand goes in a client theme (skill kit-theme).
*/
import type { PaletteInputs } from "./palette.ts";
export const meadowstackInputs: PaletteInputs = {
base: {
light: "oklch(1 0 0)",
dark: "oklch(0.155 0 0)",
},
contrast: 0.5,
};Why it matters in a business app
An internal app grows screen by screen: orders this month, approvals the next, a supplier record after that. Without tokens each screen picks its own grey, its own 14px and its own corner, and after a year the app has eleven greys and three table looks. With tokens the order table and the approval queue share one hover colour and one row height because they ask for the same names.
Tokens also make the second theme and a client's brand possible at all: dark mode is the same names with other values, not a second stylesheet.
How Meadowstack handles it
- Colours are generated.
packages/kit/src/tokensturns the page colour of each theme and one contrast value into every neutral, every text level and the focus ring, in OKLCH.npm run tokenswritespalette.css; nobody edits it by hand, and a unit test fails when it is stale. - The rest is written once. Radii, shadows, type sizes and motion lengths live in
packages/kit/src/styles/tokens.css: product text 13/20, meta 12/16, controls 32px, an entering element 160ms, a leaving one 120ms. - No way around them. The default Tailwind palette is off, so its stock colour classes (blue-500 and the rest) do not exist.
npm run check:tokensfails on hex, rgb, hsl or oklch in components, classes and inline styles, and a Claude Code hook runs it after every edit. - The rule for agents. AGENTS.md says "Never invent a size; add a token", which is what stops a coding assistant from typing
text-[15px].
Common mistakes
- Naming tokens by their look.
blue-500says nothing about where it may go. Name by role, see semantic colour tokens. - A token per screen. Twenty tokens used once are values with extra steps. A new token earns its place when a second screen needs it.
- Editing the generated file. The next
npm run tokensputs it back; change the inputs or the rule inpalette.tsinstead.
Questions
What is the difference between design tokens and CSS variables?
Tokens are the decisions: which grey is muted text, how long a panel takes to open. CSS custom properties are one way to deliver them. In Meadowstack they arrive as custom properties in palette.css and tokens.css and as Tailwind utilities built on them.
How many inputs does Meadowstack's colour palette have?
Two: the page colour for each theme and one contrast value from 0 to 1. Every neutral, text level and the focus ring follow from them, and text never drops below the WCAG floors whatever the contrast value.
Can a client's brand change the tokens?
Yes. A client theme overrides the tokens for light and dark, and the contrast guard can read that theme file to check it before it ships.
Do design tokens help when an AI assistant writes the code?
They help only when something enforces them. An assistant copies whatever it sees, so Meadowstack pairs the tokens with a guard that fails on a typed colour and runs after every edit.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app