X
Business

Stack Overflow users finally get a dark theme

Developers can now avoid the blast of white when opening Stack Overflow while coding in a dark-themed editor.
Written by Liam Tung, Contributing Writer

Developer knowledge-sharing site Stack Overflow has rolled out a dark-mode theme, finally delivering the site's most sought-after feature.

Apparently it was quite a technical and design feat to bring dark mode, which is the 12th most upvoted question on the Stack Overflow Meta community – which still doesn't support dark theme – and the top most upvoted feature request. 

It should be a welcome addition for those Stack Overflow users who were complaining that opening the site hurt their eyes after coding in the dark with an editor that supports dark mode. 

To enable the dark theme, users need to log into the site and set dark mode in user preferences. In preferences, there are now light, system setting, and dark themes to pick from. 

SEE: How to build a successful developer career (free PDF)

According to Stack Overflow's director of content, Ben Popper, there have been lots of challenges in bringing dark mode to the site, which is among the top 50 busiest sites, according to Alexa rankings. Also, besides the question and answer platform, it also has developer profiles, job listings, and product pages. 

There are no plans to implement dark mode run on the wider Stack Exchange network, which includes its many other question-and-answer sites like Ask Ubuntu, Mathematics, and Server Fault, according to Popper.       

"Many of the designs on our sites have been around long enough that converting them to dark mode would require redoing the artwork completely," noted Popper. 

"We would prefer to avoid giving anyone across our network a substandard experience and we don't want to change those elements without the input of these communities."

Some Stack Overflow users have been wondering why the site didn't enable dark mode given it's supported on macOS, Windows 10, and Chrome.

Over the past year Aaron Shekey, Stack Overflow's design systems lead, has been fielding questions and detailing the web-design challenges of enabling dark mode on the GitHub page for Stacks, the CSS & JavaScript Pattern library behind the Stack Overflow design system. 

One roadblock was that Stack Overflow supports Internet Explorer 11, which doesn't natively support CSS or cascading variables. Refactoring the site's color styles into CSS variables was suggested as a potential solution to supporting dark mode across the site. 

"In our primary.css, the legacy stylesheet responsible for questions and answers, we have 9,920 declarations and 179 unique colors. We're not talking a few hours of work. This is a sustained effort of months," explained Shekey. 

"For each hour we spend shipping a dark mode our users approve of, an hour is taken from shipping features that more directly affect our bottom line, enabling us to ship more features in a sustained, maintainable manner."

SEE: iOS and Android developers: Microsoft's Blazor for building mobile apps gains traction

While the site seems pretty consistently dark, the jobs panel is still white. However, according to Shekey, that's not a Stacks issue.  

During the beta, some sections of the site are out of scope for the new dark theme, including:

  • Homepage of Stack Overflow for non-logged in users
  • Jobs
  • Talent client portal

Stack Overflow does intend to bring dark theme to the Meta Stack Overflow site.  

stack-overflow-dark-mode.png

To enable the dark theme, users need to log into the site and set dark mode in user preferences.  

Image: Stack Overflow
Editorial standards