Thu, Sep 17
Daily Challenge
One question per day, deterministic by local date. Read it, think it through, mark it complete to extend your streak.
react · hard
How would you design and implement a light and dark theme switcher in a scalable React app?
Tokens as CSS variables under `[data-theme]` or a class on `<html>`. Resolve theme on mount from localStorage or `prefers-color-scheme`. Apply before first paint via inline `<script>` to avoid flash. Provide a React context for components to read the current theme. Persist user choice. Respect `prefers-color-scheme: dark` as default. Support system / light / dark trichotomy.
Open question