Custom accent color with gemstone presets #42
Loading…
Reference in a new issue
No description provided.
Delete branch "accent-color-presets"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The app's accent color is now user-selectable from six gemstone presets, recoloring the whole UI live.
How
The theme's primary/accent were hardcoded at hue 28 (garnet). This extracts the hue into a
--garnet-hueCSS variable that primary/accent read viaoklch(L C var(--garnet-hue)), so swapping it rotates the whole accent family while keeping lightness/chroma — and the warm-neutral backgrounds — fixed.lib/accent.ts— six presets (Garnet, Amber, Emerald, Sapphire, Amethyst, Rose), each a single hue; all clear AA contrast against the white primary-content text.prefsStore—accentIdpersisted to localStorage;useApplyAccentwrites the hue to--garnet-hueon mount and on change, so the UI recolors live.--color-primary— no per-preset image assets needed for the UI.The matching OS window-icon swap (preset gem icons) is a separate follow-up PR.
Testing
tsc, Biome, and full-repo lint pass. Verified viamake dev: each swatch recolors the whole UI and the logo live, backgrounds unchanged, and the choice survives a restart.