Claude Code
Work with Claude directly in your codebase. Build, debug, and ship from your terminal, IDE, Slack, web, and more.
Available for macOS, Linux, and Windows.
Add a dark mode toggle to the settings page. Should remember the choice and follow the system default until they pick one.
src/theme/ThemeProvider.tsx
10
export function ThemeProvider({children}: {children: ReactNode}) {11+
const prefersDark = useMediaQuery('(prefers-color-scheme: dark)')12
const stored = localStorage.getItem('theme')13+
const [mode, setMode] = useState(stored ?? (prefersDark ? 'dark' : 'light'))14
15+
useEffect(() => {16+
localStorage.setItem('theme', mode)17+
}, [mode])18
19
return (20
<ThemeContext.Provider value={{mode, setMode}}>21
{children}#112acme-dashboardclaude/settings-dark-mode-Xk4fq CI