Overview
Dark mode is mostly an exercise in token discipline. Once your colors live behind semantic variables, swapping themes is a one-line change. The remaining work is making sure the swap happens without a flash.
Highlights
- Apply the saved theme inline in <head> to avoid a flash on first paint
- Persist user choice in localStorage but fall back to prefers-color-scheme
- Test images, charts, and screenshots in both themes — they often need separate sources
Comments