DEV Community

Discussion on: Light and dark mode in just 14 lines of CSS

Collapse
 
whitep4nth3r profile image
Salma Alam-Naylor

Interesting approach! Except I'm viewing it in dark mode which shows white text on a grey background โ€”ย which I can't read ๐Ÿ˜…

Collapse
 
inspiredlabs profile image
Inspired Labs - London, United Kingdom

Exactly! Using var(--color-bg, inherit) uses the browser's fallback value. Perhaps one day, browsers will simply have a algo to do this themselves, such as Luma: css-tricks.com/switch-font-color-f...