Lena
Active member
- Joined
- Nov 26, 2019
- Messages
- 19
- Points
- 43
Every day, hundreds* of Scribblehub readers & writers are confronted with something terrible: light mode.
And this while almost all† browsers support setting dark mode preferences!
I say: stop this madness! Vote for this feature request!
*: okay, I don't actually have any numbers. But I image with people resetting their cookies and stuff it must happen at least a few times a day. I just wanted this to sound like a political ad. I originally wanted to make the title sound like one of those US laws with “patriotic” titles, but that seemed excessive.
†: 92% according to caniuse.com.
Okay, but in all seriousness, Javascript has support for asking if the OS (and/or browser depending on implementation) is currently set to dark mode, and website can automatically adapt to that. I would implement it by adding an extra option in the theme dropdown called system, which will switch between dark and light mode depending on the preferences of the user, and make that mode the standard. This is how some sites, like StackOverflow, do it.
Here is some example code:
It's also possible to use .addListener for when the reader changes the theme without refreshing the page, but honestly I don't think that happens often.
And this while almost all† browsers support setting dark mode preferences!
I say: stop this madness! Vote for this feature request!
*: okay, I don't actually have any numbers. But I image with people resetting their cookies and stuff it must happen at least a few times a day. I just wanted this to sound like a political ad. I originally wanted to make the title sound like one of those US laws with “patriotic” titles, but that seemed excessive.
†: 92% according to caniuse.com.
Okay, but in all seriousness, Javascript has support for asking if the OS (and/or browser depending on implementation) is currently set to dark mode, and website can automatically adapt to that. I would implement it by adding an extra option in the theme dropdown called system, which will switch between dark and light mode depending on the preferences of the user, and make that mode the standard. This is how some sites, like StackOverflow, do it.
Here is some example code:
JavaScript:
if (window.matchMedia("(prefers-color-scheme: dark)")){
//reader prefers dark mode
}else if (window.matchMedia("(prefers-color-scheme: light)")){
//reader prefers light mode 🤨
}else{
//reader's browser is old
}
Last edited: