Theme pairs with dark mode toggle + gear active state #127
Notifications
Total Time Spent: 1 hour 30 minutes
fen
1 hour 30 minutes
No due date set.
Dependencies
No dependencies set.
Reference: poslop/palette#127
Reference in New Issue
Block a user
Two related UI improvements plus a server-configurable default:
Gear active state: the topbar settings gear highlights like the selected nav tabs when the current page is /settings.
Theme pairs + dark mode toggle: collapse the 10 theme cards into 5 pairs (Midnight, Smooth, Pastel Lavender, Pastel Peach, Pastel Cloud). Each card shows the light variant swatches on the top row and the dark variant swatches on the bottom row. Dark mode toggle in settings next to the theme cards and as a small sun/moon icon button in the topbar. Selecting a pair applies the variant matching the current dark mode state; toggling dark mode switches to the other variant of the selected pair. Persist dark mode in localStorage palette-dark and the pair base id in palette-theme. URL ?theme= still wins and accepts both base and variant ids.
PALETTE_DEFAULT_DARK env var (Docker-configurable): server-configured default dark mode for new visitors. Unset defaults to dark ON; false/0/off turns it off. Precedence: URL ?theme= > stored pair+dark prefs > server default dark > dark on. Documented in README configuration section. Resolution logic covered by Go tests.
QA passed (PR #128): 7-file diff scoped correctly; go vet + go test clean; rendered checks on :18090 confirmed 5 pair cards x 2 rows x 5 swatches, gear class "on" on /settings only, topbar+settings dark toggles synced (aria-pressed flip midnight<->midnight-light), PALETTE_DEFAULT_DARK=false renders var dark = false (unset renders true), URL ?theme=smooth-dark wins. Merged via API, CI green on dev
19cb8d1, deployed to palette-dev and re-verified live on https://palette-dev.archfox.org (all checks pass incl. ?theme= and stored prefs precedence). Branch deleted.