Dev Tools · 2h ago
Dark mode via CSS variables, not component edits
A developer replaced ~1,200 hardcoded indigo and ~2,600 slate class usages across 130 components with CSS variables. A codemod swapped indigo- for brand- tokens, enabling global recoloring and dark mode via variable remapping. The approach eliminates per-component dark mode work and allows per-user accent colors.
Meridian48 take
This is a smart, scalable pattern for theming in Tailwind CSS, but its real-world impact depends on how many teams adopt it over the more common component-level dark mode hacks.
Read the full reporting
I added dark mode by editing CSS variables not 100 components →
DEV Community
css-variablesdark-mode