# Goal Add a light/dark mode toggle to [App Name] that remembers the user's choice. ## Requirements 1. Put a toggle button in the [location, e.g. top-right of the navbar]. 2. Default to the system preference (prefers-color-scheme) on first visit. 3. Save the choice in localStorage and apply it before first paint (no flash). 4. Drive all colors from CSS custom properties on :root. ## Constraints - Do not hard-code colors inside components. - Keep contrast at WCAG AA in both themes.
Write better AI coding prompts and get working code on the first try — free at zoeyprompts.com.