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).
In my experience that's because most users run their monitors on 100% brightness instead of turning that down. I prefer light mode unless it's really dark.
Even with Flux, setting the profile automatically breaks down at high latitudes. If you're far enough from the equator, the sun can sod off most of the year as for how it relates to human biorythms.
I'm 60°N, as with my alarm clock, I've set a static profile to follow 365 days a year since the sun is unreliable.
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!!!
Well, it is in KDE + Firefox. And yeah, the simplistic idea that day = bright and night = dark fails all the time, the OS has already other settings to deal with those failures, and your site or app should just use the system theme.
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.
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
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.
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!
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.
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.
> That's not what I want. I want a subtle shade of grey.
Does your preference change if you reduce your screen brightness?
Bright features over a really dark background can be unsettling, but that's about screen adjustment, not really about the software colors.
Anyway, I do argue that people shouldn't just pick #000 and #fff by default. But that's because if you are already using the extremes of your palette, you can't get a more extreme one when you need to emphasize something. The arguments on "unnatural" colors and visual preferences all seem baseless to me, because those numbers don't correspond with any actual physical color, they are all relative.
About dark maps, I've seen it done well. Exactly once, and I can't point you the software because it was embedded and I don't remember what the device was. But as hard as it seems to be, it is still possible.
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).
My understanding is that white on pure black can be troublesome for people with a certain level of astigmatism as they will experience halation, which can make things appear blurrier.
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.