I Thought Dark Mode Was Just a Toggle. It Turned Into a Full-System Refactor
Implementing dark mode on a personal website turned into a full UI system refactor. The key lessons: hardcoded colors had to be replaced with semantic CSS variables (e.g., --text-primary), pure black/white contrast is too harsh so grey shades work better, Tailwind's typography plugin needed explicit variable mapping, code syntax highlighting required two themes switched dynamically, SVG diagrams needed separate versions per mode, and a flash-of-wrong-theme bug required moving theme detection before browser render. Dark mode isn't a surface-level toggle — it's a cross-cutting system concern that every UI layer must support intentionally.