DEV Community

Discussion on: The Best Way To Dark Mode Your Website In My Opinion.

Collapse
 
td204 profile image
Terry

If using Javascript, why not simply add a class to the body, e.g. "dark-mode" and apply some basic styling overrides in your existing style sheet? No flashes, no new load#/HTTP requests, simply manageable if using a SCSS preprocessor

Collapse
 
zxcodes profile image
Mohammed Farmaan.

Yeah we can do that too. But few elements will be left out and will need multiple classes to get dark.