Why Your WeChat Articles Turn Dark and How to Force Light Mode in Chrome

This article explains why WeChat articles may appear with a black background due to macOS dark mode and the CSS prefers‑color‑scheme media feature, and provides two practical solutions—command‑line tweaks for Chrome and a lightweight app—to restore the original light appearance.

Programmer DD
Programmer DD
Programmer DD
Why Your WeChat Articles Turn Dark and How to Force Light Mode in Chrome

After long periods of reading WeChat public‑account articles, the author noticed that the page background suddenly turned black, which was caused by macOS using a dark theme and the article’s CSS reacting to the prefers-color-scheme media feature.

Problem Analysis: prefers-color-scheme

The prefers-color-scheme CSS media feature detects whether the user’s operating system prefers a light or dark color scheme.

Syntax no-preference: user has not specified a theme (evaluates to false as a boolean). light: operating system is set to a light theme. dark: operating system is set to a dark theme.

Example

The following CSS defines different styles for light and dark system themes, allowing the page to adapt automatically.

.day   { background:#eee; color:black; }
.night { background:#333; color:white; }

@media (prefers-color-scheme: dark) {
  .day.dark-scheme   { background:#333; color:white; }
  .night.dark-scheme { background:black; color:#ddd; }
}

@media (prefers-color-scheme: light) {
  .day.light-scheme   { background:white; color:#555; }
  .night.light-scheme { background:#eee; color:black; }
}

This code makes the front‑end page switch colors according to the OS theme, providing a smarter user experience.

How to Solve

Knowing the cause, you can restore the original light appearance in two ways.

Method 1: Command‑line Control

Run the following command in Terminal while macOS is in dark mode, then restart Chrome:

defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool YES

To revert back to the default behavior, execute:

defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool NO

Method 2: Software Control

If you need similar control for multiple applications, you can use the free utility Gray , which lets you toggle individual apps between light and dark appearances regardless of the system theme.

Gray app interface
Gray app interface

With Gray you can set Chrome to light mode while keeping the rest of the system in dark mode, simply by clicking the app’s icon.

Gray app usage example
Gray app usage example
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

macOSChromeCSSDark Modeprefers-color-scheme
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.