There's a media query, "prefers-color-scheme" supported by most browsers. With its use, the website can obtain the global configurations from the browser and use the respective CSS styles for dark mode. It could not be more simple.
If you would like to do it without using this media query for some reason, there are some ways available. You can find these resources helpful and others on the internet to achieve the same experience.
Hi Ishan,
Good, I like Dark mode mostly. :)
There's a media query, "prefers-color-scheme" supported by most browsers. With its use, the website can obtain the global configurations from the browser and use the respective CSS styles for dark mode. It could not be more simple.
How to add Dark Mode support to your portfolio website
Wells Riley ・ ・ 4 min read
Medium
If you would like to do it without using this media query for some reason, there are some ways available. You can find these resources helpful and others on the internet to achieve the same experience.
Adding Dark Mode to My Website
Jonathan Sexton ・ Mar 16 '19 ・ 4 min read