3.8 KiB
056 — Add Light * variants for the remaining colour schemes
Summary
Ticket 048 already added one light-surfaced variant, light_green
(webapp/src/lib/themes.ts:231-254, commit 5371d3e: "Adds a new
'Light Green' scheme (light-surfaced, same green/magenta hue family as
'Green') selectable alongside the existing built-ins"). The wishlist
comment that prompted 048 — "we need a Light Green alongside Green"
— is now clarified as applying to every colour scheme, not just green:
the current built-in set is dark, light, red, green, blue,
yellow, pink, orange, light_green
(webapp/src/lib/themes.ts:38-255), so red, blue, yellow, pink,
and orange still have no light-surfaced counterpart.
Adding a scheme is not fully data-driven from themes.ts alone — six
files must be kept in sync per scheme, per the no-build-step-links-them
comment at webapp/src/index.css:1-7:
webapp/src/index.css:264-300— thehtml.light_greenCSS block is the reference recipe: same hue + same accent hues as the dark counterpart, but withlight's inverted (high-lightness) surface/border/text scale, andlight's hue-neutral danger colors (comment atindex.css:264-268documents this explicitly).webapp/src/lib/themes.ts:231-254— the matchingBUILTIN_THEMESentry (used for CSS export/download and validation).webapp/src/lib/api.ts:83-93— theColorSchemeTS union type.src/settings.rs:30-42— the matching RustColorSchemeenum variant, with#[serde(rename = "light_<name>")].webapp/src/lib/useSettingsPanel.ts:24-34—THEME_CLASSES, used to apply/strip thehtml.*class.webapp/src/components/NavMenu.tsx:20-31—COLOR_SCHEMES, which drives the picker UI;schemeLabel()(NavMenu.tsx:34-35) already auto-titleslight_red→ "Light Red" by replacing underscores, so no extra label wiring is needed once a name is added to this array.
PanelChart.tsx's multi-accent color-mix() series-color logic (touched
by ticket 048) is generic per-theme rather than per-scheme-name, so it
likely needs no changes — worth a quick check while implementing, not
expected to require edits.
Tickets 047/048's original files were deleted on implementation (git
history only shows their removal commits, 5cb2dfd/7c331e7; bodies
aren't recoverable), but commit 5371d3e's message and the resulting
light_green block are sufficient as the template.
Scope
- Add
light_red,light_blue,light_yellow,light_pink, andlight_orangefollowing the exactlight_greenrecipe: same base hue and accent-hue choices as the corresponding dark-surfaced scheme,light's inverted surface/border/text lightness scale,light's neutral danger colors. - Update all six files listed above for each new scheme:
webapp/src/index.css,webapp/src/lib/themes.ts,webapp/src/lib/api.ts,src/settings.rs,webapp/src/lib/useSettingsPanel.ts,webapp/src/components/NavMenu.tsx. - Verify
schemeLabel()produces correct titles ("Light Red", "Light Blue", etc.) without additional label-mapping code. - Spot-check
PanelChart.tsx's series-color logic against one new light scheme to confirm it needs no changes (or fix it if it does).
Acceptance criteria
- All five new schemes are selectable in the settings picker
(
NavMenu.tsx), persist correctly, and are downloadable as CSS via the existing "download built-in theme" path. - Each new scheme's CSS block round-trips through
Settingsserialization/deserialization (src/settings.rs) without errors, verified with a test analogous to any existingColorSchemeserialization test. make buildandmake lintpass with the new schemes added.
Depends on
048 (implemented; this ticket extends its established pattern to the remaining base hues).