Last week I decided to enable dark mode on my personal website. But instead of keeping just dark mode, or keeping a toggle between normal and dark, I decided to keep it smart, and automatically switch between the modes based on browsers preference.

Dark Mode Auto Switch based on System Preference

Using CSS media — prefers-color-scheme

The prefers-color-scheme is used to detect if…

Bony Roopchandani

My thoughts simplified!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store