~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

The console has five palettes over one ladder of lightness

Merged
Merged chadtmiller.com asked to merge into feature/branding from chadtmiller.com/group-host:branding/palettes

PALETTE now takes five values: paper, the console's own warm palette, plus slate, neutral, sage and mauve, grays faintly tinted to go with a primary colour near their hue. Each palette is now just a hue and a chroma over one shared ladder of lightness, so text contrast is the same in all five. tokens.css loses its hand-written slate blocks.

Claude Opus 5.5 · medium effort

What changes

The palettes. PALETTES in config.rs, getBrand's knownValues and INKS in brand.ts now take paper, slate, neutral, sage and mauve. The host refuses any other value at startup: "PALETTE is one of paper, slate, neutral, sage, mauve, not neon".

The ladder. Every surface and text token (--bg, --panel, --soft, --line, --line-strong, --fg, --mute, --faint, --gray, and the light shadows and scrim) is now oklch(L calc(var(--palette-c) * f) var(--palette-h)). The lightness L and chroma factor f are fixed per token and fitted to today's paper; each L is a step on the shared ladder. A palette is one rule setting --palette-h and --palette-c on <html data-palette>. The three slate blocks are gone. Role colours, the primary and the dark shadows are unchanged.

PaletteHueChroma
paper700.028
slate2600.010
neutral00
sage1550.009
mauve3100.010

Paper doesn't visibly change. On the ladder it comes out within one unit per channel of the hex values it had (drawn page background #f7f1ea against the #f6f1ea it was).

Dark --faint is lighter, at L 0.64 instead of 0.615. It used to read at 4.17–4.22:1 on --soft, under WCAG AA's 4.5:1 for text; that came from paper's dark tokens, so it was already on main. It now reads at least 4.62:1 on the bg, panel and soft of every palette.

slate is fainter than the hand-picked slate this branch had.

Changeset: none

Why

Radix Colors offers one pure gray and several grays tinted toward a hue, and pairs an accent with the gray nearest its hue (https://www.radix-ui.com/colors/docs/palette-composition/composing-a-palette); shadcn/ui offers the same kind of choice. These four, with paper, give a palette near every common brand hue, and neutral works with any. Their tints (line chroma 0.007–0.010) sit in the range of Radix's (0.004–0.011) and shadcn's (0.003–0.007), so they stay quiet beside the role colours. Paper's strength (about 0.02) is the console's own look and stays. One ladder means a new palette is two numbers, and its contrast is already right.

host-colours.md, the change file this branch already has, now describes the five palettes.

How it was checked

  • just t --test config: 8 passed, with the new refusal message.
  • npm run check: 0 errors and 0 warnings. just lex and just fmt pass.
  • WCAG contrast computed from the ladder: body text on cards about 15.5:1 light and 14.7:1 dark in every palette; --faint at least 4.93:1 in light and 4.62:1 in dark.
  • PALETTE=<each> just look /g/lanterns.groups.test --as alice --seed full, light and dark (picture attached; left to right paper, slate, neutral, sage, mauve). Sampled from what was drawn, each page background has its palette's hue: slate 248/264, sage 165/145, mauve 301/326, neutral chroma 0.

Shortcomings

  • The dark tokens are still written twice in tokens.css, under the media query and under [data-theme='dark'], as on main. light-dark() would merge them; that belongs in its own pull.
  • With a violet primary, mauve sits near the purple --done role; with a green primary, sage sits near the green --success role. Faint tints make this mild. The docs pair each palette with primary hues, but nothing enforces it.

palettes-sheet.png

Approved

This adds the neutral, sage and mauve palettes beside paper and slate. It rebuilds the surface and text tokens as oklch(L calc(var(--palette-c) * f) var(--palette-h)), so each palette is a hue and a chroma. I found nothing that must change.

  • Consistency: PALETTES in config.rs, the getBrand knownValues, INKS in brand.ts, the config test's message, docs/reference/config.md and the changeset all list the same five values. The leftover slate references in tests/brand.rs and the other tests/config.rs cases still hold.
  • Tokens: The --palette-h and --palette-c rules sit before the token blocks. The [data-palette] selectors have lower specificity than the :root token blocks, but they only set the palette variables, so that doesn't matter. The dark values are duplicated under the media query and [data-theme='dark'] consistently, as on main.
  • Not checked: I did not recompute the contrast figures or the INKS hex values from the oklch ladder. The body says they were computed, and INKS only affects the text on primary buttons.
  • Checks: check, test, web, lexicons and e2e were still queued or running when I looked. docs passed.
Merged as d1079e0