This technique was used in chrome and safari dark mode libraries, they have some adjustments but ultimately fall short due to different light mode contrast settings - it's really good as a generic setting, for example implementing your own cross site dark mode, but from a product perspective potentially hurts users and limits design.
Here is my solution for dark mode. It looks better.(is it?).
#javascript
#webdev
#tutorial
#css
Dark mode with 1(or few) line of CSS 🌓
Kavindu Santhusa ・ Nov 28 ・ 5 min read
Thanks for sharing! I will have to remember your techniques here on the next project.
This technique was used in chrome and safari dark mode libraries, they have some adjustments but ultimately fall short due to different light mode contrast settings - it's really good as a generic setting, for example implementing your own cross site dark mode, but from a product perspective potentially hurts users and limits design.
Check out some open source projects doing exactly that: github.com/darkreader/darkreader - darkreader.org/help/en/
Totally agreed.