Freely chosen accent colour (#17) #32

Merged
miko merged 2 commits from feature/17-accent-colour into development 2026-11-02 12:29:30 +01:00
Owner

Closes #17. After review, the accent can be chosen freely instead of from the curated list (ADR-0012, partly superseding ADR-0010).

  • Setting accentColor stores the chosen #rrggbb. Old suggestion names still read as that suggestion's colour; anything else falls back to blue.
  • accentPair() derives the light and dark value in OKLCH and adjusts the lightness until it reaches WCAG AA (4.5:1) on every surface of the mode. The curated accents stay as suggestions with their hand-checked pairs.
  • Picker on /admin/settings: the suggestions with swatches, a colour field and a hex field, and a light/dark preview of the values actually used
  • The root layout sets --accent-light/-dark as inline style on <html> from the cached settings ('use cache' + the settings tag, revalidated on save)

Notes

  • next build now needs the database, because the root layout's prerendered shell reads the cached settings.
  • The hand-checked suggestions reach AA on surface but not everywhere on surface-sunken, e.g. blue at 4.33:1. See ADR-0012.

🤖 Generated with Claude Code

Closes #17. After review, the accent can be chosen freely instead of from the curated list (ADR-0012, partly superseding ADR-0010). - Setting `accentColor` stores the chosen `#rrggbb`. Old suggestion names still read as that suggestion's colour; anything else falls back to blue. - `accentPair()` derives the light and dark value in OKLCH and adjusts the lightness until it reaches WCAG AA (4.5:1) on every surface of the mode. The curated accents stay as suggestions with their hand-checked pairs. - Picker on /admin/settings: the suggestions with swatches, a colour field and a hex field, and a light/dark preview of the values actually used - The root layout sets `--accent-light/-dark` as inline style on `<html>` from the cached settings (`'use cache'` + the `settings` tag, revalidated on save) **Notes** - `next build` now needs the database, because the root layout's prerendered shell reads the cached settings. - The hand-checked suggestions reach AA on `surface` but not everywhere on `surface-sunken`, e.g. blue at 4.33:1. See ADR-0012. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Admins choose the instance's accent colour from the curated list
(ADR-0010) on /admin/settings.

- New setting accentColor, a semantic accent name, defaulting to blue;
  unknown or removed names fall back to blue
- The picker shows each accent as a button and a link on the light and
  on the dark surface, via preview-only tokens (surface-light/-dark,
  accent-light/-dark) and a nested data-accent
- The root layout sets data-accent on <html> from the cached settings,
  so the shells stay prerendered and saving revalidates them; next build
  now needs the database
- Accent display names live in src/theme/accent.ts; the unused
  resolveAccent is removed (the settings parser does the fallback)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko changed title from Selectable accent colour (#17) to Freely chosen accent colour (#17) 2026-11-02 12:21:47 +01:00
Admins now choose any accent colour instead of one from the curated list
(ADR-0012, partly superseding ADR-0010).

- accentColor stores the chosen #rrggbb; suggestion names stored before
  still read as that suggestion's colour, anything else falls back to blue
- accentPair() derives the light- and dark-mode value in OKLCH: darkened
  or lightened until 4.5:1 on every surface of the mode, chroma lowered
  only to stay in gamut; the curated accents stay as suggestions with
  their hand-checked pairs
- The picker offers the suggestions with swatches, a colour field and a
  hex field, and previews the values actually used
- The root layout sets --accent-light/-dark as inline style on <html>,
  still from the settings cache
- Colour maths lives in src/theme/colour.ts; a test checks the contrast
  surfaces against globals.css

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 040190b212 into development 2026-11-02 12:29:30 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!32
No description provided.