Dark Mode, Forced Dark, and the Samsung Browser

This is the story of how a deliberately simple community website ended up with two colour themes, an automated screenshot test suite, and a fix that applies only to one browser.

As a member of the Repair Café Zug club, I am motivated to use my skills to bring a small improvement to the lives of our community members. As the webmaster for the club's website, I feel the same responsibility when working on the site. It is an item used by our community, and I should make it work for them whenever I can. Even a static site for a small club can be crafted lovingly to work smoothly for the visitor.

A website for everyone

The Repair Café Zug website exists for the community. One of its most important goals is to make the Repair Café, and the website itself, available to everyone.

Many of our visitors are elderly and may not be comfortable with technology. Owning an expensive new phone should not give anyone a better experience of the site. Some people use strict privacy settings that turn off JavaScript, and nobody likes clicking through cookie banners.

So the site was hand-crafted with minimal HTML and CSS, and no JavaScript and no cookies. It had a single colour theme, so one pass through the pages was enough to check it, and it was designed to look the same everywhere.

“Some things are invisible in dark mode”

Then I was told that in dark mode, some parts of the site could not be seen.

At the time I had very little experience with light and dark themes on a basic website. I assumed that if I defined only one set of colours, those were the colours the browser would use.

That assumption was wrong. Some people really like dark mode and set their phones and browsers to use it for everything. Some browsers can also force a dark mode onto websites that don't define one. They do this by recolouring the page using their own rules.

On the Repair Café Zug website, forced dark mode got several things wrong. The two most important controls became barely visible: the menu lines (the “hamburger” icon at the top) and the chevron that opens Nächste Veranstaltungen (upcoming events) at the bottom.

As designed Forced dark
Home page in light mode: white menu lines and a white chevron on black bars Home page in forced dark mode: the menu lines and the chevron are almost black on black
Menu icon, light mode Menu icon, forced dark: lines nearly invisible
Events bar, light mode Events bar, forced dark: chevron nearly invisible

Forced dark also broke images. Several PNG images on the site were carefully drawn as black lines on a transparent background. When the browser turns the page background dark, the black lines fade into it. The Sicherheitsprüfung (safety check) page shows this with the electrical protection class symbols:

As designed Forced dark
Protection class I table in light mode: the earth symbol is clearly black on light grey Same table in forced dark mode: the black earth symbol nearly disappears into the dark background

The “before” screenshots show the site as it was before any dark mode work. Forced dark is simulated with Chromium's built-in auto-dark mode, which is the engine Samsung Internet is built on.

Two ways forward

There seemed to be two options:

  1. Design an explicit dark mode. Define dark colours for everything that interacts: backgrounds, tables, text, and controls.
  2. Tell browsers to show only the original design, for example with color-scheme: only light.

I chose the first option, even though it is more complex and harder to maintain. People who choose dark mode deserve a site that respects that choice instead of ignoring it.

This took some non-trivial work:

The screenshot tests confirmed that the new dark mode worked:

Designed dark mode Inverted symbol
Home page in the designed dark mode: white menu lines and chevron, clearly visible Protection class table in dark mode: the earth symbol is now white on dark grey

Then came the Samsung Browser

Unlike the other browsers, Samsung Internet has only implemented the “force dark” approach, which changes colours based on a few simple rules. Even when a website declares its own carefully designed dark mode, the Samsung Browser ignores it. It loads the light design and then darkens it according to its own rules. So on Samsung phones, all the dark mode work changed nothing. The menu lines and the chevron were still almost invisible.

For about five years, the Samsung Browser has had a hidden setting, in one form or another, that makes it respect a website's own dark mode. It is called Adaptive Forced Dark Mode, and it is off by default.

I briefly considered, and tested, showing visitors a note asking them to turn this setting on. It would improve both our site and any other site that falls into the same trap. But asking our visitors to do a technical task is not a realistic option. Samsung decided to override websites' designs with a forced dark mode, even where that doesn't work. A small Verein's website is not the place to fix that corporate decision. (If you are on the Samsung Browser, you can enable the setting at internet://flags#enable-adaptive-force-dark.)

Three options

That left three options:

  1. Leave the website as it is, with standard light and dark modes that only the Samsung Browser ignores.
  2. Redesign the website from the ground up so that it survives Samsung's darkening rules, which are not published and can change at any time.
  3. Add a fix that applies only to the Samsung Browser.

Fewer than 3% of users in Switzerland use the Samsung Browser in dark mode. That may sound low, but it means a couple of visitors to every Repair Café event probably see the site with this problem on their Samsung phone.

Pie chart of browser share in Switzerland, all devices, October 2026: Chrome 40.4%, Safari 30.3%, Edge 12.3%, Firefox 6.3%, Samsung Internet 3.8%, other 7.0%
Browser share in Switzerland, all devices, October 2026. Samsung Internet accounts for 3.8% of all browser use, and 7.6% on mobile phones. Source: StatCounter Global Stats.

I chose option 3. When the browser identifies itself as Samsung Internet, the site adds a white border around the important controls that would otherwise fade into the background. Other browsers get exactly the same page as before.

Even then, the Samsung Browser darkens the white border to grey. 🙁 But the controls are now visible, and I count that as close enough.

Forced dark, no fix Forced dark, with the Samsung fix
Menu icon in forced dark mode without the fix: lines nearly invisible Menu icon in forced dark mode with the fix: grey outlined lines are visible
Events chevron in forced dark mode without the fix: nearly invisible Events chevron in forced dark mode with the fix: grey outline is visible

Throughout all of this, I relied on a spare Samsung phone that I happened to have. The problem only appears on a Samsung phone in dark mode, visiting the site with the Samsung Browser. Firefox, Chrome, Brave and others on the same phone are fine. The screenshot tests can approximate it, but Samsung's exact rules aren't public, so every important change had to be checked on the real device.

The balance

The website's main goal is to be easily accessible to the whole community. Its second important goal is to be easy to maintain, so that it stays active and accessible over time.

Samsung's forced dark implementation was getting in the way of the first goal. The fix moved that burden onto the second: the site now has two colour themes to maintain and a special Samsung-only workaround. This is not ideal, but I think it strikes the right balance.

— Aner Ben-Artzi, webmaster, Repair Café Zug website