DEV Community

loading...

Discussion on: Dark Mode in React using Hooks

Collapse
joeattardi profile image
Joe Attardi

Nice! There is also a media query, prefers-color-scheme, that you can use to automatically detect if the user's operating system is set to dark mode!

developer.mozilla.org/en-US/docs/W...

Collapse
rohit1508 profile image
Rohit kumar singh Author

Correct Joe, I will use that in my next article. But prefers-color-scheme not supported by many of the browsers as of now. so, I thought of going with this approach.

Forem Open with the Forem app