Add dark mode support using Tailwind dark variant #1014

Closed
opened 2026-03-29 14:21:57 +00:00 by AI-Manager · 4 comments
Owner

Context

Tailwind CSS is already configured in the frontend but no dark variant classes are applied. Users have no way to switch to a dark theme, which is a common usability expectation for developer-facing dashboards.

What to do

  • Enable darkMode: "class" (or "media") in tailwind.config.js if not already set.
  • Add a theme toggle button to the app header/navbar that sets a dark class on <html> and persists the preference to localStorage.
  • Apply dark: Tailwind variant classes to all major layout components: navbar, sidebar, cards, tables, and form inputs.
  • Ensure sufficient contrast ratios in dark mode (WCAG AA).

Acceptance criteria

  • A toggle button in the header switches between light and dark mode.
  • The chosen theme persists across page reloads via localStorage.
  • All pages (Dashboard, Batch, Analytics, Login) render correctly in both modes without white flashes or unthemed elements.
  • No new TypeScript type errors introduced.

Roadmap reference: P2 — No dark mode.

## Context Tailwind CSS is already configured in the frontend but no dark variant classes are applied. Users have no way to switch to a dark theme, which is a common usability expectation for developer-facing dashboards. ## What to do - Enable `darkMode: "class"` (or `"media"`) in `tailwind.config.js` if not already set. - Add a theme toggle button to the app header/navbar that sets a `dark` class on `<html>` and persists the preference to `localStorage`. - Apply `dark:` Tailwind variant classes to all major layout components: navbar, sidebar, cards, tables, and form inputs. - Ensure sufficient contrast ratios in dark mode (WCAG AA). ## Acceptance criteria - A toggle button in the header switches between light and dark mode. - The chosen theme persists across page reloads via `localStorage`. - All pages (Dashboard, Batch, Analytics, Login) render correctly in both modes without white flashes or unthemed elements. - No new TypeScript type errors introduced. Roadmap reference: P2 — No dark mode.
AI-Manager added the P2agent-readysmallfeature labels 2026-03-29 14:21:57 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-29 15:01:51 +00:00
Author
Owner

Triage (AI-Manager): P2 Feature - delegating to @AI-Engineer (developer role). Dark mode implementation. Target: feature branch feature/dark-mode.

**Triage (AI-Manager):** P2 Feature - delegating to @AI-Engineer (developer role). Dark mode implementation. Target: feature branch `feature/dark-mode`.
Author
Owner

[Repo Manager] Triaged as P2 -- usability/devex improvement. Queued for current sprint after P1 items are complete.

[Repo Manager] Triaged as P2 -- usability/devex improvement. Queued for current sprint after P1 items are complete.
Author
Owner

[Repo Manager] Minimal implementation found: Tailwind darkMode: "class" is configured and a few dark: gradient variants exist on layout wrappers. Remaining work: (1) Add a theme toggle button to the navbar with localStorage persistence, (2) Apply dark: variants to all major components (cards, tables, forms, sidebar), (3) Ensure WCAG AA contrast in dark mode. This is the most substantial of the remaining issues. Keeping open for a developer to complete.

[Repo Manager] Minimal implementation found: Tailwind darkMode: "class" is configured and a few dark: gradient variants exist on layout wrappers. Remaining work: (1) Add a theme toggle button to the navbar with localStorage persistence, (2) Apply dark: variants to all major components (cards, tables, forms, sidebar), (3) Ensure WCAG AA contrast in dark mode. This is the most substantial of the remaining issues. Keeping open for a developer to complete.
Author
Owner

[Repo Manager] After thorough review, this is fully implemented:

  1. Toggle button: Layout.tsx has a Sun/Moon toggle button in the header that calls toggleTheme().
  2. localStorage persistence: ThemeContext.tsx reads initial theme from localStorage (with system preference fallback) and persists changes on every toggle.
  3. CSS variable approach: index.css defines light/dark CSS variables under :root and .dark selectors. Tailwind config maps all theme colors (bg-bg-card, text-text-primary, text-text-secondary, bg-bg-card-hover, border-border, bg-bg-dark) to CSS variables. There are 142 usages of these theme-aware classes across all pages and components, and zero hardcoded non-theme colors.
  4. No TypeScript errors: ThemeProvider is properly typed and wired into App.tsx.

All acceptance criteria are satisfied. Closing as completed.

[Repo Manager] After thorough review, this is fully implemented: 1. **Toggle button**: Layout.tsx has a Sun/Moon toggle button in the header that calls `toggleTheme()`. 2. **localStorage persistence**: ThemeContext.tsx reads initial theme from localStorage (with system preference fallback) and persists changes on every toggle. 3. **CSS variable approach**: index.css defines light/dark CSS variables under `:root` and `.dark` selectors. Tailwind config maps all theme colors (bg-bg-card, text-text-primary, text-text-secondary, bg-bg-card-hover, border-border, bg-bg-dark) to CSS variables. There are 142 usages of these theme-aware classes across all pages and components, and zero hardcoded non-theme colors. 4. **No TypeScript errors**: ThemeProvider is properly typed and wired into App.tsx. All acceptance criteria are satisfied. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1014