Please use `prefers-color-scheme` to respect users' environments and default preferences instead. It's also worth noting that, for some people, this is more than just a cosmetic choice.
>Automatically setting the theme is a nice touch for most, but accessibility comes first, and if the user has a preference, it's always right to respect their choice.
>You can check for users' colour scheme preferences in CSS & JavaScript with the following snippets:
Nice experiment, but my Mac already switches to dark mode at the right time (I’m sure windows and Linux can do the same if you want it that way). So defaulting to system preference would already result in the same behaviour (while also covering users who always prefer light or dark).
I used to think I am like this, until I noticed, in bright daylight readability is way way better in light mode. So nowdays I switch depending on the light settings (and curse all the apps who do not follow the OS settings, where I have to do it manually).
That's funny, I implemented something similar for my stumpwm config (common lisp window manager). I created a matrix of themes for the WM, emacs, my terminal (kitty), Firefox, and my RGB light panels that change with time of day: day, late afternoon/evening, sunset/twilight, night, post-midnight, and then broken into multiple desktop variations as a way of visually knowing what virtual desktop I'm currently on. Stumpwm coordinates all of the themes for all the apps and synchronizes them with time and desktop and whatnot.
Really helps with circadian rhythm, I've found. Especially because I take a live webcam feed and convolve a hexagonal mask to match my light panel's layout, so it's like having a low res window from whatever webcam I would like. And, at sunset to night, it smoothly fades the light panels into a display that represents a angle compressed sky projection of the stars relative to a fixed location moon with live phase displayed.
Nice! We considered this exact approach but never shipped it in the end. The geolocation permission is probably unnecessary friction and probably an overkill imho... Timezone + rough location (country-level from IP) would get 95% accuracy without the prompt. Most users will bounce on that permission dialog.
Solid work though, especially the twilight transitions. Loving it!!!
I use Noir extension on my iphone/ipad, does it automatically when iOS/iPadOS goes into night/dark mode (which is also geo-based). Works great on OLED screens!
Currently, the switch from light to dark (or vice versa) is very disruptive. Imagine switching every few minutes just because some clouds pass by, to me that sounds terrible.
Enter the era when every website wants camera permissions ...
Or maybe there is some other sensor you could use? Like if photoelectric effect triggered some noise in your microphone or slightly more TCP retransmissions some such
Good idea to make it more humane. It should depend on insolation in the current place (it could differ in close locations), or user preferences. I'd prefer to turn automatic dark mode off at all. It would be great if the transition to dark mode be invisible. Like after locking laptop's screen, not in the process of work.
Syncing dark mode or f.lux or OS night mode to local sunlight is nice if you live near the equator, but for folks living in the far north, it actually makes seasonal changes so much worse.
I know this is from 2021, but for the love of god stop with the toggles. I have one toggle, it works system-wide. Respect it. You don't have to guess what theme I want, I already told my OS.
Strong disagree here. Many apps don't implement dark mode in the way I want. They seem to think dark mode is for conserving battery life on OLED displays and make the majority of their UI #000000. That's not what I want. I want a subtle shade of grey. I'd rather choose light mode for an individual app if that app doesn't implement dark mode correctly.
Another point is that some types of content just don't work with dark mode. Maps for example. I have used multiple apps that use maps or present data on a map. None of the maps look good when dark. As such I always turn off dark mode if an app displays maps as part of its main user journey.
Interesting, this is the first time I've heard that opinion. For myself, I get annoyed whenever a dark mode isn't #000000; it's not about saving battery, it's about the pixels being off, which I find more readable. (I got an OLED specifically because it makes it more comfortable spending time in a terminal.)
Can you say more about your use case and why you prefer gray over black?
Black is too much contrast. The high contrast simply hurts my eyes. For a gray theme nicely done, look at the GitHub gray theme (called "soft dark") as an example.
Fascinating. Different use cases for different people. On GitHub, I use the default dark mode ("dark default") and then enable "high contrast", which makes the background black. (I also get annoyed when light modes are dark grey on light grey, rather than black on white for maximum contrast.)
There's a CSS preference for contrast. It seems easy enough to handle `@media(prefers-contrast: low)` and set a gray background. The contentious part would presumably be the default; I would have thought #000000 was the obvious default for a dark mode but apparently that's not what everyone prefers. Ideally, OSes and browsers would expose controls for this in a straightforward way, the way they handle dark mode.
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...
Sure, but the default for any app should be to use the setting from the OS/DE/WM and only diverge from that if the user consciously decides to alter it in the app's settings (in whichever direction).
I don't like all toggles to be gone since dark mode quality varies a lot, and also I may want some sites or apps one way and some another way. So removing the choice and slapping all configuration under a single "dark/light" browser toggle really annoys me, especially when sites stop providing the toggles because it's more convenient to just use the CSS property and do less. To me it's another step in the dumbing down of the UIs that I regret.
Perfectly ok with defaulting to that global setting though.
Similar vibes to the relative date infection with no option to opt out and get the full date in most sites nowadays.
Please use `prefers-color-scheme` to respect users' environments and default preferences instead. It's also worth noting that, for some people, this is more than just a cosmetic choice.
From TFA:
>Automatically setting the theme is a nice touch for most, but accessibility comes first, and if the user has a preference, it's always right to respect their choice.
>You can check for users' colour scheme preferences in CSS & JavaScript with the following snippets:
I'm glad it's mentioned, but I was trying to say "never do the thing TFA recommends" in a less harsh way, and inadvertently dulled my point.
Nice experiment, but my Mac already switches to dark mode at the right time (I’m sure windows and Linux can do the same if you want it that way). So defaulting to system preference would already result in the same behaviour (while also covering users who always prefer light or dark).
DarkModeBuddy uses the Mac's light sensor. It works so well that I wonder why it's not how the OS works.
I don't care if it's sunny outside. Rainy days in Germany can get quite dark long before Night Shift kicks in.
Most people that I know that prefer dark mode (myself included) prefer it regardless of sunlight or ambient lighting.
I used to think I am like this, until I noticed, in bright daylight readability is way way better in light mode. So nowdays I switch depending on the light settings (and curse all the apps who do not follow the OS settings, where I have to do it manually).
For me it’s light themes all the way. I rather turn the brightness down than switch to dark mode.
It has to be really bright before I will switch my ebook app or feed reader to black on white instead of white on black.
At a certain point, white text on black just isn’t readable but the inverse is somehow.
Conversely, I prefer light mode regardless of sunlight.
I prefer dark mode for image-heavy content and coding, and light mode for long amounts of natural language text, regardless of time of day.
Reminds me of f.lux: https://justgetflux.com/
or gtk-redshift (if you are on X11).
Happily KDE has it built in and does both location detection, enter co-ords or click map for setting it how you want.
That's funny, I implemented something similar for my stumpwm config (common lisp window manager). I created a matrix of themes for the WM, emacs, my terminal (kitty), Firefox, and my RGB light panels that change with time of day: day, late afternoon/evening, sunset/twilight, night, post-midnight, and then broken into multiple desktop variations as a way of visually knowing what virtual desktop I'm currently on. Stumpwm coordinates all of the themes for all the apps and synchronizes them with time and desktop and whatnot.
Really helps with circadian rhythm, I've found. Especially because I take a live webcam feed and convolve a hexagonal mask to match my light panel's layout, so it's like having a low res window from whatever webcam I would like. And, at sunset to night, it smoothly fades the light panels into a display that represents a angle compressed sky projection of the stars relative to a fixed location moon with live phase displayed.
Obligatory images:
The day themes: https://youtu.be/danulUB-J-k
Light panels: https://imgbox.com/MQfPNjtI <- sunset on the hex display
https://imgbox.com/qcrFxncU <- random cloudy day hex display
https://imgbox.com/EOFk63WZ <- a night still of the hex display
Nice! We considered this exact approach but never shipped it in the end. The geolocation permission is probably unnecessary friction and probably an overkill imho... Timezone + rough location (country-level from IP) would get 95% accuracy without the prompt. Most users will bounce on that permission dialog.
Solid work though, especially the twilight transitions. Loving it!!!
This should be an OS feature and apps should just use the system theme.
Both iOS and Android allow you to set dark mode by some schedule, and that's conveyed by their respective browsers to websites.
It is an OS setting to follow sunrise/sunset.
I use Noir extension on my iphone/ipad, does it automatically when iOS/iPadOS goes into night/dark mode (which is also geo-based). Works great on OLED screens!
I think it would be more useful to toggle it based on ambient lighting.
Currently, the switch from light to dark (or vice versa) is very disruptive. Imagine switching every few minutes just because some clouds pass by, to me that sounds terrible.
Enter the era when every website wants camera permissions ...
Or maybe there is some other sensor you could use? Like if photoelectric effect triggered some noise in your microphone or slightly more TCP retransmissions some such
Most devices have a built-in ambient light sensor:
https://en.wikipedia.org/wiki/Ambient_light_sensor
Good idea to make it more humane. It should depend on insolation in the current place (it could differ in close locations), or user preferences. I'd prefer to turn automatic dark mode off at all. It would be great if the transition to dark mode be invisible. Like after locking laptop's screen, not in the process of work.
Would be nice to fade instead of binary dark/light
Syncing dark mode or f.lux or OS night mode to local sunlight is nice if you live near the equator, but for folks living in the far north, it actually makes seasonal changes so much worse.
Let the user decide the schedule, please.
I believe most OS that have an option to do this by location also allow for manually specifying the schedule
I know this is from 2021, but for the love of god stop with the toggles. I have one toggle, it works system-wide. Respect it. You don't have to guess what theme I want, I already told my OS.
Strong disagree here. Many apps don't implement dark mode in the way I want. They seem to think dark mode is for conserving battery life on OLED displays and make the majority of their UI #000000. That's not what I want. I want a subtle shade of grey. I'd rather choose light mode for an individual app if that app doesn't implement dark mode correctly.
Another point is that some types of content just don't work with dark mode. Maps for example. I have used multiple apps that use maps or present data on a map. None of the maps look good when dark. As such I always turn off dark mode if an app displays maps as part of its main user journey.
Interesting, this is the first time I've heard that opinion. For myself, I get annoyed whenever a dark mode isn't #000000; it's not about saving battery, it's about the pixels being off, which I find more readable. (I got an OLED specifically because it makes it more comfortable spending time in a terminal.)
Can you say more about your use case and why you prefer gray over black?
Black is too much contrast. The high contrast simply hurts my eyes. For a gray theme nicely done, look at the GitHub gray theme (called "soft dark") as an example.
Fascinating. Different use cases for different people. On GitHub, I use the default dark mode ("dark default") and then enable "high contrast", which makes the background black. (I also get annoyed when light modes are dark grey on light grey, rather than black on white for maximum contrast.)
There's a CSS preference for contrast. It seems easy enough to handle `@media(prefers-contrast: low)` and set a gray background. The contentious part would presumably be the default; I would have thought #000000 was the obvious default for a dark mode but apparently that's not what everyone prefers. Ideally, OSes and browsers would expose controls for this in a straightforward way, the way they handle dark mode. https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/A...
Sure, but the default for any app should be to use the setting from the OS/DE/WM and only diverge from that if the user consciously decides to alter it in the app's settings (in whichever direction).
Just like sibling here, hard disagree.
I don't like all toggles to be gone since dark mode quality varies a lot, and also I may want some sites or apps one way and some another way. So removing the choice and slapping all configuration under a single "dark/light" browser toggle really annoys me, especially when sites stop providing the toggles because it's more convenient to just use the CSS property and do less. To me it's another step in the dumbing down of the UIs that I regret.
Perfectly ok with defaulting to that global setting though.
Similar vibes to the relative date infection with no option to opt out and get the full date in most sites nowadays.