Files
CatoandClaude 36536730c5 Light theme: follow the device, or the reader's pick in the header (#414)
Solon was pinned to dark. The shared tokens already carry both themes
(:root light, .dark overrides), so this decides which one is on:

- src/components/theme/: the choices, a head script that sets the `dark`
  class, `data-theme` and `color-scheme` before the first paint (no flash),
  and a header toggle (Light / Dark / Device) kept in localStorage. No
  framework or Solon name in theme.ts, so it can move into
  @bitbaum/design-tokens ({#theme-package}).
- <html> drops the pinned class and carries suppressHydrationWarning.
- Photographs stay dark on purpose: FullBleed and AudienceTile wear `dark`,
  and the transparent header over a page that opens on a photograph does
  too (HEADER_OVER_PHOTO_ROUTES, held to the pages by a test).
- Bands that used bg-surface-public (near-black in both themes) use a new
  `.band`: the public surface in dark, white in light. The footer too.
- bip-kit's variables are set in both themes, not only under html.dark.
- The law globe reads its tokens again when <html>'s class changes.
- text-white and text-green-400 replaced by tokens.
- Toggle words in all five languages; e2e check of device, pick and reload.
- Docs: ui-guidelines theme section, CLAUDE.md, AGENTS.md, README, ROADMAP
  {#themes}, CHANGELOG {#theme-light}.


Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-08 08:38:24 +01:00

12 KiB

UI guidelines

Created 2026-01-08. Last modified 2026-11-08: the light theme is built. The device decides unless the reader picks Light, Dark or Device in the header; photographs, and the header over them, stay dark on purpose. Earlier, 2026-10-01: the Places map is built and draws only with tokens, read from the page (map-colours.ts), so it follows whichever theme is on. Earlier the same day: Solon gets a light theme beside the dark one (decided 2026-09-30, not built yet), both from the package's tokens. Earlier, 2026-09-30: two depths, everyday pages (EVERYDAY_ROUTES) plain with "Technical details" one click away, the deep side as technical as it needs to be; the render check that holds everyday pages to it. Earlier the same day: every inner page uses PageLayout, every text box uses .field, and stored values are shown through src/lib/domain/plain-words.ts, never as stored.

Where the design system actually lives

Not in this document:

Where Role
@bitbaum/design-tokens, installed here as @fleet/design-tokens (repo) Token SSOT for Solon and Loki — every colour, face, radius, rhythm and measure, plus the self-hosted font files and the Tailwind preset.
src/app/globals.css Solon-specific rules only. Defining a token here fails the build.
tailwind.config.js Consumes the shared preset. Defines no colours, fonts or geometry.
scripts/design-system-check.js Enforcement. Run by pnpm run design:check, which pnpm run verify runs.

This page describes conventions a linter cannot check. It deliberately lists no colour values — a palette written down twice is a palette that will disagree with itself. If you want to know what --surface-raised is, read the package.

One family, three products

Solon and Loki no longer copy tokens — they import them from one package (Solon under the alias @fleet/design-tokens, Loki as @bitbaum/design-tokens). OrangeCat does not depend on the package; its globals.css mirrors some of the values, so a change in the package does not reach OrangeCat by itself. They used to be copied, and they drifted: this file once claimed Solon's tokens matched OrangeCat's "by name and by value" while the two shared neither. Copies drift; imports cannot.

To retheme the whole stack, edit the ▼▼▼ THE KNOBS ▼▼▼ block in the package's tokens.css, tag a release, and bump the dependency in Solon and Loki.

Light and dark

Solon has both themes the package ships (decided 2026-09-30, built 2026-11-08). The device decides (prefers-color-scheme) until the reader picks Light, Dark or Device from the icon button in the header; the choice is kept in their browser's localStorage, never sent to the server. The module is src/components/theme/:

  • theme.ts — the choices, the storage key, and THEME_SCRIPT, the few lines <head> runs before the first paint, so nothing flashes. It sets the dark class the tokens key on, data-theme (the attribute bip-kit and the fleet's other packages read) and color-scheme. <html> carries suppressHydrationWarning because the server's HTML has none of them.
  • theme-toggle.tsx — the button and its three choices. The words come from Nav.theme* in messages/*.json; the component holds no language or brand.

Neither file names anything of Solon's: they are shaped to move into @bitbaum/design-tokens (ROADMAP {#theme-package}).

The rules:

  • A colour is never written for one theme. Use the token roles; they flip. text-white, bg-black and a hex in a component are bugs in one theme.
  • Type on a photograph is dark on purpose, in both themes. FullBleed and AudienceTile carry dark, which switches the tokens for that subtree: their type sits on a black scrim, where only light type reads. The transparent header over a page that opens on a photograph wears dark too, decided from the path (HEADER_OVER_PHOTO_ROUTES in src/lib/site-config.ts, held to the pages by a test) so the server renders it right. The code sample on /integration is a terminal and stays dark as well.
  • A band is .band, not bg-surface-public. --surface-public is near-black in both themes; a section set off from the page uses .band (globals.css), the public surface in dark and white on the off-white page in light.
  • Canvas drawing reads tokens from the page and reads them again when <html>'s class changes: src/components/places/map-colours.ts for the Places map (--map-scale-1…7, --map-no-data, --map-boundary, --accent-primary), and the law globe the same way. MapLibre's own stylesheet is unlayered, so the few overrides of it in globals.css (the hover label) are unlayered too, in tokens.
  • The social card (opengraph-image.tsx) and the web manifest are one image and one colour outside any page, and stay on the near-black public surface.

Headlines are the sans

Solon sets headlines in the sans, heavy and tight — the same voice OrangeCat and Loki speak in. It used to be the one product setting them in the shared serif, which made it read as a different company from its siblings.

  • .headline — sentence case, for app screens and long titles.
  • .headline-caps — uppercase, for the short statement a full-screen section makes. A few words, never a sentence.
  • .kicker — the small uppercase label above a headline.

Both are defined once in globals.css. design:check fails on font-display and on any display-size text without a headline style (or font-mono for data).

Full-screen sections and photographs

The front page and /hire are built from FullBleed sections (src/components/site/full-bleed.tsx): one photograph, one statement bottom-left over a scrim, one action. Pass daylight for bright photographs — the heavier scrim keeps text readable over sky and facades. Actions on a photograph use .btn-frame / .btn-frame-accent; inside forms use .btn-primary / .btn-secondary.

Every photograph is registered in src/lib/content/photos.ts with its author, licence and source, and /credits renders that list — a page cannot use a photo the credits page does not know about. Only public-domain, CC0 or CC BY images, and none that shows or implies a customer.

Rules the checker enforces

pnpm run design:check fails the build on any of these, so you will find out before CI does:

  • No Tailwind greys (slate / gray / zinc / neutral) — use text-fg-*, bg-surface-*, border-*.
  • No arbitrary hex (bg-[#…]) and no white/NN opacity — add a semantic token.
  • No raw radii (rounded-lg) — use rounded-control / rounded-surface / rounded-pill.
  • No drop shadows. Hierarchy is border and type, not elevation.
  • No component gradients. Brand surfaces belong in the token package.
  • No max-w-7xl. Width is one decision: .section-shell.
  • No typeface named in a component (font-['…']) — use .headline / font-sans / font-mono.
  • No font-display (the serif) anywhere in Solon, and no display-size text without a headline style. See above.
  • No token redefined in globals.css. The package owns them.

The legacy navy / solon-* palette is deleted, not aliased — any leftover usage fails the build rather than quietly rendering the old look.

Layout

The root layout does not wrap pages in a container. Sections are full-bleed and own their own width via .section-shell, so a hero reaches the edges of the screen instead of rendering as a box floating in a gutter.

Rhythm and display type

Pace is one decision, not a per-section guess. Use the utilities, never a raw py-20 sm:py-28:

Utility Token Use
py-section --section-py marketing sections
py-section-tight --section-py-tight content pages (PageLayout)
text-display-1 --text-display-1 the one hero headline on a page
text-display-2 --text-display-2 section headings, content-page h1
text-display-3 --text-display-3 card headings

All five are clamp(), so a heading needs no breakpoint variants — one size resolves itself per viewport. If you find yourself writing text-3xl sm:text-4xl lg:text-5xl, reach for a display token instead.

Headlines take their width from the column they sit in. Do not also give an h1 its own max-width: you end up with two rules where only one ever binds. Running text uses max-w-lede (short intros) or max-w-copy (paragraphs).

Components

Component File
Header / nav src/components/ui/navigation.tsx
Footer src/components/ui/footer.tsx
Logo src/components/ui/logo.tsx
Auth control src/components/ui/auth-control.tsx
Page shell (every inner page: kicker, title, one-line description) src/components/ui/page-layout.tsx
The way down to the exact record (IDs, addresses, raw payloads, API links) src/components/ui/technical-details.tsx
Long-form pages (whitepaper, questions, blog) markdown in content/, read by src/lib/content/reading.ts through bip-kit (bip-kit/node, parseFaq), rendered inside PageLayout in a .bp-theme wrapper; routes are force-static
Text box, select, text area the .field class in src/app/globals.css (add py-3 on a text area)
Full-screen section src/components/site/full-bleed.tsx

Links come from src/lib/site-config.ts: MENU (the header's mega menu), SITE_SECTIONS (footer, mobile menu) and PRIMARY_NAV (each MENU section's own link, tested to point at known pages). Keep components small, prefer semantic HTML, and keep ARIA roles on the menu primitives.

What the checker cannot see

CSS is invisible to lint, typecheck and unit tests: a class with no rule behind it renders as nothing and every gate stays green. tests/e2e/render.spec.ts runs in CI's integration job against a built app and checks that the main actions are styled, the header fits on one line at 1440px, no page scrolls sideways at 390px, and the mobile menu opens. Still: look at a page before shipping it.

Copy

Every sentence on a translated page lives in messages/<locale>.json (five languages; see AGENTS.md, "Language"). Write for the person who will run a group, not for engineers: no crypto or protocol vocabulary on the front pages (the details live on /security and /governance/voting). Never assemble a sentence by concatenation; see AGENTS.md, "Language".

Two depths

Solon has two depths, and both matter.

  • Everyday pages (EVERYDAY_ROUTES in src/lib/site-config.ts: the dashboard, decisions, suggesting, joining, founding, the record, and each organization's page) are for someone who has never read about governance. They say what happened in plain words. The exact record (identifiers, Bitcoin addresses, raw payloads, API paths) sits under Technical details (TechnicalDetails), closed by default, on the same page.
  • The deep side (the governance explainers under /governance/*, /security, /api, /ecosystem, /treasury/bitcoin, /whitepaper, /faq, /blog, /changelog and /roadmap) is for the reader who wants to know exactly how it works. It may be as technical as it needs to be: precise terms (quorum, electorate, BIP-137) are the point there. Everyday pages link down to it ("How this works →"); it never has to link up.

tests/e2e/render.spec.ts ("the everyday pages show no stored codes") fails the build if an everyday page shows a stored value outside Technical details.

Plain words on everyday pages

Assume the reader is not technical. A value the database stores (OPEN, SIMPLE_MAJORITY, HUMANS_ONLY, TREASURY_SPEND) never reaches the page as stored: statuses go through proposalStanding(), the rules of a vote through votingRules() (both in src/lib/domain/plain-words.ts), and category names come from CATEGORY_LABEL in src/lib/config/governance.ts, and entries on the record read through EVENT_LABEL and eventGloss() in src/lib/domain/event-gloss.ts. Amounts read in bitcoin (bitcoinAmount()), not satoshis. The words people see are "suggest", "start the vote", "agreed" and "turned down", not "file", "open a session", "quorum" or "electorate". Error messages say what happened and what to do ("The connection dropped, so nothing was saved. Please try again."), not "network error".