Site looks broken in dark mode, how do I stop the background changing?

Visitors on phones with dark mode see our light sections turn dark grey with dark text on top. Unreadable. Is the browser forcing this, and can CSS tell it to leave our colours alone?
2

Leave A Reply

Log in to post an answer.

2 Answers

noah_ads Nov 12, 2026
amaraw
you can also put a color-scheme meta tag set to light in the head, same effect as the css rule and some browsers pick it up earlier. the other thing that breaks under forced dark mode is a dark logo on a transparent png, it just vanishes. give it a light background or keep a second version for dark.
lilad Oct 14, 2026
amaraw
check your theme css first. a lot of themes ship a @media (prefers-color-scheme: dark) block that flips the background but forgets half the text colours, so it looks broken rather than dark. search the stylesheet for prefers-color-scheme and either finish those rules or delete them. if it's the browser forcing it (Samsung Internet and some Android Chrome setups invert pages on their own), add color-scheme: only light on :root and set an explicit background colour on body instead of leaving it transparent. that stops most of it. a few forced-dark modes still override anything you do, so don't chase it forever.