Design system overview
The platform’s design system is the Meridian design system, implemented as a three-target token graph with one owner: design-tokens/tokens.cjs is the source of truth for every colour role (light + dark), and a generator fans it out to the three platforms. The web’s apps/svelte-web/src/routes/layout.css imports the generated colour block and adds the web-only tokens — type scale, radius ramp, shadows, motion, charts, sidebar aliases — as Tailwind v4 @theme inline keys. The native apps read the generated Tokens.swift / Tokens.kt via @Environment(\.tokens) (iOS) / LocalTokens.current (Android). Typography is Hanken Grotesk for UI and body text and Space Grotesk for display roles (page titles, prices, KPIs) on every platform. The brand TTFs live once in design-tokens/fonts/; the same exporter copies them into MeridianUI (Resources/Fonts/) and the Android :core:design-system (res/font/, snake_case names), and the web print-ad renderer embeds them from there (bun scripts/gen-print-ad-fonts.ts).
Token flow
Section titled “Token flow”flowchart LR
Meridian["Meridian design system<br/>(README · tokens.json)"]
TokensCjs["design-tokens/tokens.cjs<br/>light + dark, every colour role"]
Exporter["bun design-tokens/export-native-tokens.mjs"]
GeneratedCss["apps/svelte-web/src/routes/tokens.generated.css<br/>:root + .dark"]
LayoutCss["layout.css<br/>@import + web-only tokens + @theme inline"]
Tailwind["Tailwind v4 utilities"]
Swift["native/MeridianUI/…/Tokens.swift"]
Kotlin["apps/android/core/design-system/…/Tokens.kt"]
Meridian --> TokensCjs --> Exporter
Exporter --> GeneratedCss --> LayoutCss --> Tailwind
Exporter --> Swift
Exporter --> Kotlin
A colour change lands in tokens.cjs, then bun design-tokens/export-native-tokens.mjs rewrites all three outputs, which are committed. CI regenerates them on every web PR and fails on a diff, so the committed files can never drift from the source. The generated CSS is hex; the docs page below converts nothing.
What lives where
Section titled “What lives where”| Subject | Page | Generation |
|---|---|---|
| Colours (the shared palette + the web-only tokens), type scale, spacing, radius, shadows | Tokens | Auto-generated every build from tokens.generated.css + layout.css — the count on that page is the live one. |
| Web bits-ui-wrapped primitives + the shared native primitive packages | Components | Hand-authored catalog organized by tier. |
| Design intent — property-first philosophy, status taxonomy, dark mode strategy, a11y floor | Principles | Hand-authored synthesis of the team’s design intent. |
For framework-specific patterns (form actions, kebab-case filenames, icon library rules) see Conventions → Web and Conventions → Mobile (Native).
Platform-only tokens
Section titled “Platform-only tokens”Most colour roles exist on all three platforms. The exceptions, by design:
- Native only —
favoriteChip/favoriteChipBorder(the spec-fixed white heart chip and its black hairline; the web draws the same chip withoverlay-chip). - Web only —
--favorite-heart(an alias of--primary-solid),--primary-solid-hover/--primary-solid-active(native buttons use opacity for pressed states),--warning-solid,--scrim,--chart-1…5, the--sidebar-*family (aliases of the shared palette, kept for the shadcn-shaped sidebar primitive), and the non-colour scales:--text-*,--radius-*,--shadow-*,--ease-*and theduration-*utilities. - Mode-invariant on every platform —
primary-solid,media-overlay(-foreground),scrim-chip,overlay-chip,on-photo,on-ink, thenav-ink-*chrome family: they carry the same value in light and dark because they sit over photos or on the fixed ink chrome.
Enforcement
Section titled “Enforcement”.github/workflows/ci.yml→ Design tokens in sync: regenerates the three outputs and fails on a diff..claude/agents/design-review.md— runs a token-anchored visual inspection (colour resolution vs. the tokens, spacing scale, typography hierarchy, status badge colours, both light + dark themes, WCAG 2.1 AA keyboard / contrast / labels) on Playwright-renderable surfaces..claude/agents/convention-reviewer.md— flags, on web, arbitrarytext-[Npx]/rounded-[Npx]values, hex colour utilities anddark:colour overrides (the dark token set swaps colours; adark:override is a defect per Meridian governance); on native, hardcodedColorliterals, rawcornerRadius:/RoundedCornerShape(N.dp)literals and raw Material3 buttons..claude/skills/mobile-ui-audit/SKILL.md— the native checklist (hardcoded colours, static palette refs, raw buttons and dialog slots, hardcoded strings,Origin/ Bearer regressions).
The agents are invoked manually from Claude Code (@design-review / @mobile-ui-audit); only the token-sync check runs in CI.
Adding a new token
Section titled “Adding a new token”- Add the role to both palettes in
design-tokens/tokens.cjs(#rrggbb, orrgba(r, g, b, a)for a mode-invariant alpha colour). Nested keys flatten to camelCase natively and kebab-case on the web (navInk.active→navInkActive/--nav-ink-active). - Run
bun design-tokens/export-native-tokens.mjsfrom the repo root and commitTokens.swift,Tokens.ktandtokens.generated.css. - Expose it to Tailwind: add
--color-<name>: var(--<name>);to the@theme inlineblock inlayout.css. - Run
bun --filter @repo/docs build— the regenerated Tokens page picks up the new row automatically.
A web-only token (a shadow, a radius step, a chart colour) goes straight into layout.css.