To change a color based on whether Light Mode or Dark Mode used, you’d typically use a prefers-color-scheme Media Query. To make things easier, CSS now comes with a utility function named light-dark(). The function accepts two color values as its arguments. Based on which color scheme you are actively using, it will output the first or the second argument.
Bookmarks
Recent posts
- 10:35 (+0200)
If you are building UIs with accessibility in mind then this is a blog for you. It explores common interface components and comes up with a better, more robust, and accessible version of it.
09:47 (+0200)A great collection of release notes pages from world-famous software companies to get inspired.
22:06 (+0200)CSS now supports color spaces that allow us to access colors outside of the sRGB gamut. This means that you can support HD (high definition) displays, using colors from HD gamuts. This support comes with new functions to make better use of color on the web.
14:51 (+0200)As someone who’s still experimenting with this IndieWeb thing, this article came very helpful with lots of takeaways. Soon after restructuring my website, I’ll start with the integration of content syndication, webmentions, etc, where this article will be of great help.
14:15 (+0200)