In addition you can implement prefers-color-scheme media queries to also trigger dark mode, if this is set in user preferences: developer.mozilla.org/en-US/docs/W...
I'm a friendly, non-dev, cisgender guy from NC who enjoys playing music/making noise, hiking, eating veggies, and hanging out with my best friend/wife + our 3 kitties + 1 greyhound.
In addition you can implement
prefers-color-scheme
media queries to also trigger dark mode, if this is set in user preferences: developer.mozilla.org/en-US/docs/W...I also read somewhere that you can also hook into the ambient sensor of the laptop.
Not sure if the following was the original published source but that's where I read it.
blog.arnellebalane.com/using-the-a...
That's awesome!
Do you have a link to your code? The code I posted in the article are only the parts of the code that have to do with dark/light mode.
Love the way this dark/light mode functions.
Also, seriously cool cover image for this post. 😀
Thanks 😁!
I use dark mode too. But your method is more simple and straightforward.
I added the codepen at the bottom of the article.
But what about IE? Aren't CSS variables not supported in that unsightly browser?
That's pretty slick.
OnClick the C needs to be capitalized
This is pretty awesome. So cool seeing such an easy way to implement such a highly requested feature in many applications.
This is slick. Similar to how DEV does it but this is more elegant.
Thank you for the kind words!
You have two head tags
I'll write this code in a codesandbox and add it to the article.