325

Original issue from 2013: Why is there no dark theme on SO?

It's 2019. Operating Systems have started having a user preference setting for a light UI or a dark UI. Windows 10, iOS 13 and MacOS 10.14 all support this.

The browsers now pass the user's preference through to the webpage via CSS via the media query for prefers-color-scheme. Safari and Firefox both have this shipping in the stable versions of their browsers. Chrome's is in Beta and will be stable soon (v76).

UPDATE: Chrome is now shipping this with the stable versions and a majority of users in the world (currently over 75%, per: https://caniuse.com/#feat=prefers-color-scheme) have the ability to have the browser identify if the user prefers light or dark color scheme. This is an accessibility issue for many users as well as a power saving option for mobile devices.

Should Stack Overflow respect the user's OS level preferences and support a dark mode directly? In other words without the user having to jump through hurdles, install userstyle css files or extensions but instead just respect the OS settings the user has selected?

It seems like the world has changed since 2013 when there was no OS level -> browser level user preference. While CSS is required to implement this no S.O. UX or user profile schema change is required. OS vendors and browser vendors are encouraging apps and webpages to support dark mode. Shouldn't S.O. reconsider in light of changing situations?

23
  • 96
    I feel like the priorities of SO Inc. are pretty outlandish. They abandoned the mobile app and don't include a mode which would be achievable with a pretty simple CSS swap. Commented Jun 18, 2019 at 11:35
  • 41
    I wonder why nobody mentions this is an accessibility issue. Commented Jun 19, 2019 at 19:57
  • 2
    @TamásSengel but there is a stackexchange app now. Which I like better Commented Jun 20, 2019 at 8:09
  • 2
    I think there are far more important things SO could spend time on. Fine tuning and evaluating the Ask a question wizard, for example. And if it proves to have the desired effect, consider porting that one SE-wide. As long as such things are the priority, then I couldn't care less if the default theme is light, dark or purple with unicorn gif animations. Commented Jun 20, 2019 at 8:36
  • 4
    I don't know anybody who codes in an editor with a white background, for obvious reasons—I don't think I've ever even seen it. And as often as programmers reference SO as they code, one would think that a dark UI would have been an option from day 1. There's nothing like turning to a bright white screen to look something up on SO after hours of relaxed coding on a calming, dark UI. Commented Jun 20, 2019 at 16:37
  • 7
    @J... - White text on black is actually harder on your eyes. I wrote about it, in a very similar answer at MSE requesting this exact same feature. I do appreciate the humor though. Commented Jun 20, 2019 at 17:59
  • 7
    @TravisJ My eyes disagree. Also, the science and reasoning expressed in that post to justify said claims are highly questionable. Black on white is perfectly sensible on paper or other reflective media. Not on a luminescent display. Commented Jun 20, 2019 at 18:28
  • 2
    @TravisJ Previously I was merely talking about subjective comfort. You're implicitly implying that white text on black will promote degradation of visual acuity, however. Do you have any evidence to back up that implied statement? I don't think it exists, to be honest. Commented Jun 20, 2019 at 19:06
  • 2
    @TravisJ I don't feel you even addressed the previous claims. They're not worth addressing. It's just a random opinion quoted from some random website that botches science so badly that it doesn't even merit consideration. Commented Jun 20, 2019 at 20:46
  • 2
    There is real science here. Just take it from Robert H. Shmerling, MD at Harvard: "The text and images on a computer screen are made up of pixels with blurry edges. The eyes have to work harder to focus on them compared with text and images on a printed page. This may lead to eye strain." Keep in mind, white text on a black background creates this effect more than black text on white background. Harvard health goes on to state: "Optimize contrast. Black text on a bright white screen is best." Commented Jun 20, 2019 at 21:21
  • 7
    @TravisJ A random opinion from an MD's blog is not peer-reviewed science. To the best of my knowledge there exists no legitimate science to suggest that light-on-dark or dark-on-light colour schemes contribute anything to deleterious eye damage over the other. It's a subjective preference about subjective comfort. Commented Jun 24, 2019 at 11:49
  • 6
    @TravisJ You're the one who has made a striking claim - that simply changing the colours on a monitor can promote eye injury. I don't have to prove anything - you do. By 'random' I mean it is a lone voice outside the sphere of peer-reviewed science. I have not seen any real science to support what you suggest. Commented Jun 24, 2019 at 18:10
  • 2
    In fairness to everyone else reading this post who will at least review or research, here are just a few of the thousands of studies done highlighting the advantages of black text on white background (generally referred to as positive polarity): pdfs.semanticscholar.org/c349/… jdobr.es/pdf/Dobres-etal-2017-Ambient.pdf pdfs.semanticscholar.org/1605/… Commented Jun 24, 2019 at 21:58
  • 7
    @TravisJ That doesn't address the claim that black-on-white increases damage to the eye. I'll grant that in certain lighting scenarios there are arguments in favour of balancing the average display luminosity with that of the ambient room, but that's not really about dark on light or light on dark. You claimed dark-on-light would increase the risk of eye injury or damage. You have shown no evidence for this. I'm not being disrespectful, this is how science works. I would be interested to read any such study - I'm not aware that any exists. Commented Jun 24, 2019 at 22:49
  • 3
    As someone with floaters, ocular migraines and general eye strain issues, I can say this is very much an accessibility issue. If you don't have these kinds of issues, it's hard for you to be able to know what those of us with these kinds of issues deal with. So dark mode is very much needed. I work around it with browser extensions or chrome flags, but that should not be necessary for this big of a site... Commented Jan 6, 2020 at 1:57

3 Answers 3

99

The current situation at Stack Exchange

To summarize staff member Aaron Shekey's comment on this issue in Stack Exchange's GitHub repository, the new Stacks design doesn't have code coverage(?) to swap themes based on user-preference or OS setting.

A dark theme will also introduce additional complexity to support when developing new features or fixing existing bugs. This is not feasible when there are over 200 themes supporting about the same number of Network sites, as you would also have to test each one individually on top of testing desktop/tablet/mobile breakpoints.

While a dark theme is a highly-requested feature and one I would also welcome, I personally do not see this happening anytime soon even when it has been added to the Roadmap as I understand the complexity involved.

The next best solution

In the meantime, I have created a userscript "Stack Exchange Dark Mode" that works for ALL Network sites (a bold claim, but try it out yourself!), and supports all moderator/hidden pages as well (like post timelines). I am using this and will actively fix bugs when I come across them, especially when design changes.

My userscript also automatically does two levels of dark, which you can't implement using userstyles. There's a black/midnight mode for very late nights (10 pm-6 am), and a dark-grayish mode all other times.

Features

  • Supports all network sites, not just Stack Overflow!
  • Works on Chat.SO, Chat.SE, Chat.MSE!
  • Dual dark themes - midnight black for late nights
  • Inverts SVG colours
  • Some elements have reduced opacity until focused/mouseover (sidebar modules/images/timestamps). Some important colours are retained.
  • Code highlighting in darker colours
  • Darker post revision colours
  • Dark code snippet editor
  • Ensures no blinding white elements even if SO adds new features in future
  • Works on all ~66 SOMU userscripts (found here)
  • Support for SO, SU, SF, and other network site logos (instead of just plain white)
    image
  • Open source

Install

19
  • 20
    I'm using Sam's dark theme and can report that barring some minor hiccups like inconsistencies with background blended images on certain site themes (who honestly cares, anyways), the dark mode userscript works wonders and hasn't broken anything substantial for me yet, having tested it on more then 30 network sites so far. Commented Jun 18, 2019 at 6:14
  • 1
    Oh and it also works well on chat.SE, chat.SO, chat.MSE and SEDE Commented Jun 18, 2019 at 6:22
  • 70
    Writes a bold claim in bold. when meta is so meta.. xkcd.com/917 Commented Jun 18, 2019 at 8:05
  • 7
    This is what I love about this community. Everybody is so talented in different ways and uses that talent to help us all. Good question aksed, perfect answer given 1 hour later. And great tool Sam! Commented Jun 18, 2019 at 8:11
  • 2
    Is the caveat that the userscript doesn't have code coverage either? Otherwise I'm struggling to see how it's easy in one and not the other...? (n.b. I cannot install userscripts on my company machine) Commented Jun 18, 2019 at 9:04
  • 4
    @Pureferret the caveat is it's not guaranteed to work for every aspect of every site, and is unofficial Commented Jun 18, 2019 at 11:39
  • 131
    This doesn't make sense. Your post basically says "it's not feasible, but here, I made it". If you've created a script that supports "all network sites", then why can't SE just use that script, or do something themselves? Commented Jun 18, 2019 at 11:49
  • 30
    Also, I feel like supporting StackOverflow would already be a huge plus, because it's the largest site and developers work late night 😉 Plus, the question reads "should StackOverflow revisit dark mode", not StackExchange. Commented Jun 18, 2019 at 11:49
  • 6
    Dark Reader works fine with StackExchange. Bonus: You get dark mode for the rest of the web as well :) Commented Jun 18, 2019 at 15:07
  • 20
    So "dark mode" is a no go because of complexity, yet each exchange site can have its own theme? If individual users can do it, like here, here, here and here to name a few, then surely a team of developers can figure something out. Commented Jun 18, 2019 at 16:17
  • 23
    It's amazing what a single developer with a good attitude can do. But when a bunch of people gets into a scoping meeting the difficulty gets multiplied. Great job @samuel-liew Commented Jun 18, 2019 at 22:41
  • 1
    the new Stacks design doesn't have code coverage to swap themes based on ... OS setting — That's not someting Stack has to figure out; a native media query is supported (or will be in the near future) in multiple browsers. Commented Jun 19, 2019 at 17:38
  • 51
    Maintaining two themes is not feasible? Ok, just abandon the light one then... Commented Jun 20, 2019 at 8:09
  • 2
    I had to google it. It's @media (prefers-color-scheme: dark) { ... } (also light and no-preference), supported in Chrome, Firefox and Safari (but not Safari on iOS). developer.mozilla.org/en-US/docs/Web/CSS/@media/… Commented Jun 20, 2019 at 10:19
  • 5
    It's blinding. I get up at 2:00 AM. Three screens in dark mode. Mellow. I come to stackoverflow and it's the elephant in the room. Glaring bright white on the browser. Ruins the whole setup. Please don't become like Craigslist.org stuck with a clunky old interface because it's too much trouble to change or people are stubborn. Dark Mode isn't a passing fad, it's here to stay. People are going to increasingly seek options to hae it available. Commented Jan 6, 2020 at 10:12
19

Stack Overflow now has a dark mode, currently in beta. Thanks SO team!

https://stackoverflow.blog/2020/03/30/introducing-dark-mode-for-stack-overflow/

enter image description here

1
  • 1
    Love it! When will it be implemented on the rest of the Stack Exchange sites (including Meta SO)? Commented Mar 30, 2020 at 21:55
2

The Dark Reader browser extension/add-on works really well. It's automatic and doesn't require the web site designers to change their code on the web server.

Google Chrome:

Firefox:

Safari:

0

You must log in to answer this question.