Add dark mode toggle#3
Conversation
- useDarkMode.js: singleton composable that toggles `html.dark` class and persists choice in localStorage; no flash on reload because class is applied at module-load time before first render - App.vue: CSS custom properties on :root (light) and html.dark (dark) cover page bg, card bg, borders, text, and table colors; useDarkMode() initialized in setup to guarantee early class application - AppSidebar.vue: moon/sun toggle button in sidebar-bottom; collapses to icon-only (32px) when sidebar is collapsed, with tooltip Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
@claude what do you think? |
|
Claude finished @robbfo's task in 1m 28s —— View job Review: dark mode toggleOverall this is well-scoped and clean. The singleton composable pattern matches One bug to fix before merge
body {
background: var(--bg-page);
color: var(--text-body); /* was: #1e293b */
}Worth considering (not blockers)
Things I liked
Test plan noteYou haven't checked any boxes in the PR description's test plan yet. Since the visible-correctness story depends on actually toggling and walking the views (especially with the hardcoded
|
Summary
useDarkMode.js— singleton composable (same pattern asuseFilters/useSidebar); applieshtml.darkclass immediately at module load (no flash), persists preference inlocalStorageApp.vue— CSS custom properties on:root/html.darkdrive all light/dark values for page background, cards, borders, text colors, and tables; no new classes needed in templatesAppSidebar.vue— moon/sun icon toggle button in.sidebar-bottom; collapses to icon-only with tooltip when sidebar is in 56px modeDesign tokens added:
--bg-page#f8fafc#0f172a--bg-card#ffffff#1e293b--border-card#e2e8f0rgba(255,255,255,0.08)--text-primary#0f172a#f1f5f9--text-secondary#64748b#94a3b8--table-row-hover#f8fafc#243349Known scope: global layout styles are themed; view-specific scoped CSS (chart labels, inline SVG) retains hardcoded colors — those would be addressed in a follow-up.
Test plan
🤖 Generated with Claude Code