-
Notifications
You must be signed in to change notification settings - Fork 176
feat: implement dark mode with complete semantic color system #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Install next-themes package - Create ThemeProvider component with localStorage persistence - Create ModeToggle cycling button (Light → Dark → System) - Update layout.tsx: - Wrap app with ThemeProvider - Add suppressHydrationWarning to html tag - Replace bg-gray-50 with bg-background - Update navigation.tsx: - Add ModeToggle button next to LogoutButton - Replace bg-white with bg-card - Remove hard-coded text colors **Complete semantic color audit (54 violations fixed):** - dashboard.page.tsx: Replace all gray/blue/green/purple with semantic - todo-card.tsx: text-muted-foreground, text-primary, text-destructive - todo-list.page.tsx: text-muted-foreground variants - delete-todo.tsx: text/bg-destructive for delete actions - todo-form.tsx: border-border, text-primary for upload UI - edit-todo.page.tsx: text-muted-foreground - new-todo.page.tsx: text-muted-foreground Priority/status badge colors kept as-is (semantic data visualization). Dark mode now fully functional with proper theme-aware colors.
WalkthroughThe changes implement a theme system using next-themes, introducing ThemeProvider wrapper and ModeToggle components. All hardcoded color classes across the application are replaced with design tokens to support dynamic theming capabilities. Changes
Sequence DiagramsequenceDiagram
participant User
participant App as Root Layout
participant TP as ThemeProvider
participant MT as ModeToggle
participant NTh as next-themes
User->>App: Load application
App->>TP: Wrap children with ThemeProvider
TP->>NTh: Initialize with attribute="class", defaultTheme="system"
NTh-->>TP: Theme state ready
TP-->>App: Render children
App-->>User: Display app with current theme
User->>MT: Click theme toggle button
MT->>MT: Cycle theme (light→dark→system)
MT->>NTh: Update theme via next-themes
NTh->>NTh: Apply class to html element
NTh-->>MT: Theme updated
MT-->>User: UI reflects new theme
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
🧰 Additional context used🧬 Code graph analysis (3)src/modules/todos/new-todo.page.tsx (2)
src/components/navigation.tsx (2)
src/app/layout.tsx (1)
🔇 Additional comments (14)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Implements dark mode with a cycling theme toggle and fixes all hard-coded Tailwind colors to use shadcn/ui semantic color system.
Changes
New Features
New Components
Complete Color Audit (54 violations fixed across 7 files)
dashboard.page.tsx (9 fixes)
text-gray-900→ default (usestext-foreground)text-gray-600→text-muted-foregroundbg-blue/green/purple-100→bg-primary/10text-blue/green/purple-600→text-primarytodo-card.tsx (6 fixes)
text-gray-500/400/600→text-muted-foreground(with opacity)text-blue-600→text-primarytext-red-600→text-destructivetext-gray-500→text-muted-foregroundtodo-list.page.tsx (4 fixes)
text-gray-600→text-muted-foregroundtext-gray-*→text-muted-foreground(with opacity)delete-todo.tsx (2 fixes)
text-red-600→text-destructivebg-red-600→bg-destructivetodo-form.tsx (4 fixes)
border-gray-300→border-bordertext-gray-400→text-muted-foregroundtext-blue-600→text-primarytext-gray-500→text-muted-foregroundedit-todo.page.tsx (1 fix)
text-gray-600→text-muted-foregroundnew-todo.page.tsx (1 fix)
text-gray-600→text-muted-foregroundLayout Updates
suppressHydrationWarning, usebg-backgroundbg-cardPackage Changes
next-themes@0.4.6dependencyExceptions (Intentionally Kept)
✅ Priority/status badges in todo-card.tsx - Semantic data visualization colors (green=low, yellow=medium, red=urgent, etc.)
✅ Destructive button text-white - Proper contrast pairing with bg-destructive
Benefits
✨ Theme-aware: All colors adapt automatically to light/dark/system
✨ Accessible: Proper contrast in all themes
✨ Maintainable: Change entire theme by editing CSS variables
✨ Professional: Follows shadcn/ui and Tailwind v4 best practices
✨ No flash: Hydration-safe implementation prevents theme flicker
User Experience
Before: No dark mode, hard-coded light colors only
After:
Testing
Implements essential UX feature from improvement audit. Addresses the need for modern dark mode support with complete semantic color consistency.
Summary by CodeRabbit
New Features
Style