Complexity: Medium — 150 pts
Summary
StellarFlow is dark-mode only. Some users prefer a light theme, especially in bright environments. This issue adds a theme toggle that switches between the current dark theme and a light variant, persisted in localStorage.
Files to Create/Modify
- Create:
src/context/ThemeContext.tsx
- Modify:
src/index.css — add [data-theme="light"] CSS variable overrides
- Modify:
tailwind.config.js — wire colors to CSS variables
- Modify:
src/App.tsx — wrap with <ThemeProvider>
- Modify:
src/pages/DashboardPage.tsx — add Sun/Moon toggle button to header
Implementation Notes
index.css
Define all colors under :root (dark defaults) and override with [data-theme="light"] — at minimum: --bg-ink, --bg-surface, --bg-card, --border-color, --text-primary, --text-muted.
ThemeContext
- Read
localStorage.getItem('stellarflow:theme') for initial value, fallback to 'dark'
- On change, set
document.documentElement.setAttribute('data-theme', theme) and write to localStorage
- Expose
{ theme, toggle }
tailwind.config.js
Reference CSS variables in the theme.extend.colors mapping so Tailwind classes pick up theme changes at runtime.
Acceptance Criteria
Screen Recording Requirements
- Dashboard in dark mode (default)
- Click theme toggle → all pages switch to light mode instantly
- Refresh the page → light mode persists
- Toggle back to dark mode
Complexity: Medium — 150 pts
Summary
StellarFlow is dark-mode only. Some users prefer a light theme, especially in bright environments. This issue adds a theme toggle that switches between the current dark theme and a light variant, persisted in
localStorage.Files to Create/Modify
src/context/ThemeContext.tsxsrc/index.css— add[data-theme="light"]CSS variable overridestailwind.config.js— wire colors to CSS variablessrc/App.tsx— wrap with<ThemeProvider>src/pages/DashboardPage.tsx— add Sun/Moon toggle button to headerImplementation Notes
index.cssDefine all colors under
:root(dark defaults) and override with[data-theme="light"]— at minimum:--bg-ink,--bg-surface,--bg-card,--border-color,--text-primary,--text-muted.ThemeContextlocalStorage.getItem('stellarflow:theme')for initial value, fallback to'dark'document.documentElement.setAttribute('data-theme', theme)and write to localStorage{ theme, toggle }tailwind.config.jsReference CSS variables in the
theme.extend.colorsmapping so Tailwind classes pick up theme changes at runtime.Acceptance Criteria
localStorageScreen Recording Requirements