Re:CSS Only dark mode
by Cu3PO42 on Saturday June 24, 2023 @05:47AM
(#36457175)
This approach can be massively simplified by using CSS variables for your colors and only putting the color definitions in a separate file.
[ Parent
| on HN ]
Re:CSS Only dark mode
by austin-cheney on Saturday June 24, 2023 @05:54AM
(#36457204)
With consideration for accessibility this depends on the simplicity of the layout. In order to achieve WCAG 2.0 AA compliance color combinations must achieve at least a 4.5x luminosity ratio. That can mean different things may require color changes that were not required in the default scheme, as well as the opposite. As a result you really need files with different rules for that 20% that requires more than different color values.