Add prebuilt colour themes, including a pure-black OLED theme #47

Open
opened 2026-08-18 05:58:15 +00:00 by logan · 0 comments
Collaborator

Report

A couple of prebuilt themes to choose from, one of them a pure-dark OLED theme. Keep the yellow accent across them.

Findings

  • The ramps are data: frontend/src/store/theme-store.ts's SHADE_PALETTES, applied to :root at runtime. (tokens.css.ts holds only the type scale and icon sizes; the var(--yj-…, #fallback) at every call site is dead in practice.)
  • Contrast is computed from that table by theme-contrast.test.ts, so a new palette is checked automatically — every text colour must clear 4.5:1 against every surface it can sit on. A pure-black ramp will be the hardest case, and note that bgOverlay is deliberately not a text surface on the dark ramp.
  • Fills are fixed across themes (--yj-error, --yj-success) and carry a computed foreground (readableOn(), accentTextOn()), so the yellow accent stays legible without per-theme work.
  • make ui-visual cannot see any of this — the component tier renders the fallbacks, because the theme only reaches :root in the real app.

Direction

Add palettes to SHADE_PALETTES (OLED pure black, plus at least one more — a warm light and/or a mid grey), a theme picker in Settings, and let the contrast test do the checking. Verify the OLED ramp on a real screen for tertiary/secondary text, which is where a pure-black surface bites.

**Report** A couple of prebuilt themes to choose from, one of them a pure-dark OLED theme. Keep the yellow accent across them. **Findings** - The ramps are data: `frontend/src/store/theme-store.ts`'s `SHADE_PALETTES`, applied to `:root` at runtime. (`tokens.css.ts` holds only the type scale and icon sizes; the `var(--yj-…, #fallback)` at every call site is dead in practice.) - Contrast is computed from that table by `theme-contrast.test.ts`, so a new palette is checked automatically — every text colour must clear 4.5:1 against every surface it can sit on. A pure-black ramp will be the hardest case, and note that `bgOverlay` is deliberately *not* a text surface on the dark ramp. - Fills are fixed across themes (`--yj-error`, `--yj-success`) and carry a **computed** foreground (`readableOn()`, `accentTextOn()`), so the yellow accent stays legible without per-theme work. - `make ui-visual` cannot see any of this — the component tier renders the fallbacks, because the theme only reaches `:root` in the real app. **Direction** Add palettes to `SHADE_PALETTES` (OLED pure black, plus at least one more — a warm light and/or a mid grey), a theme picker in Settings, and let the contrast test do the checking. Verify the OLED ramp on a real screen for tertiary/secondary text, which is where a pure-black surface bites.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yonlu/yellowjacket#47