How to fix Chrome not respecting dark mode on a website
Jul 15, 2025 am 12:21 AMWhen Chrome does not respect dark mode, you can check the system and browser settings in turn, use developer tools to troubleshoot media query problems, and force enabled through plug-ins or experimental functions. First, make sure that both the operating system and Chrome's dark mode are enabled correctly; second, use the developer tools to check whether prefers-color-scheme: dark is effective; if it is still invalid, try the Dark Reader plug-in or enable Chrome's experimental forced dark mode function; website developers should use standard media queries, avoid hard-coded backgrounds, and test multi-device compatibility.
Chrome sometimes does not display web pages in the dark mode set by the system or browser, which is usually because the website itself does not adapt to dark mode correctly, or some Chrome settings interfere with its normal application. If you find that Chrome does not respect the dark mode of the system, you can try the following methods to troubleshoot and fix the problem.

Check the dark mode settings of the system and browser
First make sure your operating system and Chrome browser are enabled:
- Windows/macOS/Linux : Enter system settings and confirm that "Dark Theme" or "Dark Mode" is enabled.
- Chrome settings :
- Open
chrome://settings/appearance
- Make sure Use System Theme is turned on, or manually set the Chrome theme to dark.
- Open
If none of these settings are wrong but the page is still on, it is likely that the website itself's CSS overwrites the browser's preferences.

Use the developer tool to check if the media query is effective
Many websites use CSS's @media (prefers-color-scheme: dark)
to detect users' color preferences. You can use Chrome developer tools to see if this media query is correctly identified:
- Right-click on the page → “Check”
- Switch to the Elements tab
- Find
prefers-color-scheme: dark
related rules in the style panel - Check whether the rule has been overwritten or disabled (such as replaced by more specific CSS or JavaScript)
You can also run the following code in the console to test whether the browser thinks it is currently dark mode:

window.matchMedia('(prefers-color-scheme: dark)').matches
If false
is returned, it means that the browser does not recognize the dark mode; if true
but the page does not become dark, it means that the website does not correctly apply the corresponding style.
Force dark mode (temporary solution)
If you just want to force a website to use dark mode, you can use some extended or experimental features to do it:
Dark Reader (Chrome plugin)
This plug-in will force the web page to render in a dark style, which can take effect even if the website does not support it. It is suitable for temporarily solving the problems of individual websites.Enable Chrome Experimental Features
Enter the address bar:chrome://flags/#enable-force-dark
Set the option to Enabled , and it takes effect after restarting the browser. This will allow Chrome to automatically "flip" web pages that do not support dark mode into dark colors.
Note: These methods may cause some web pages to be plagiarized or the pictures are abnormal. It is recommended to use only if necessary.
If you are a website developer, how to ensure compatibility with dark mode
If you maintain the website yourself and want it to respond correctly to the user's dark mode preferences, here are a few key points:
Using standard media queries:
@media (prefers-color-scheme: dark) { body { background: #121212; color: #ffff; } }
Avoid hard-coded background colors, try to use variables or system colors
Don't rely on JavaScript to switch topics unless you need additional interactive control
Test on different devices, especially when using mobile and desktop
Some frameworks (such as Tailwind CSS, Bootstrap) already have built-in dark mode support. Remember to view the document and enable relevant configurations.
Basically these are the methods. When Chrome does not respect dark mode, start with system settings and browser configuration, then check whether the website is adaptable, and finally consider using plug-ins or experimental functions to bypass the restrictions. Not every time can be solved perfectly, but most of the time, a compromise can be found.
The above is the detailed content of How to fix Chrome not respecting dark mode on a website. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Google Chrome is a free and fast multi-platform web browser developed by Google. It is known for its speed, stability and reliability. Chrome is based on the open source Chromium project and is widely used on devices such as desktops, laptops, tablets and smartphones. The browser has a clean interface and a wide range of customizable options, allowing users to personalize it according to their preferences. In addition, Chrome has a huge library of extensions that provide additional features such as ad blocking, password management and language translation, further enhancing the browsing experience.

Android phones can install Chrome extensions through KiwiBrowser. KiwiBrowser is an open source browser based on Chromium on the Android side. It supports the installation of the Chrome Web Store extension. The process is: Open Kiwi and enter the Chrome store, search for extensions, and click "Add to Chrome" to complete the installation; when using it, you need to pay attention to network stability, extension compatibility, permission granting and installation quantity; other alternatives include FirefoxMobile and YandexBrowser, but Kiwi is still the most stable and convenient choice at present.

On macOS, you can modify Safari's UserAgent through developer tools or terminals, but iOS/iPadOS does not support it. The specific methods are: 1. Use the developer tools to modify temporarily: select preset UA after enabling the development menu; 2. Permanent modification through the terminal: enter the command to write a custom UA; 3. iOS/iPadOS cannot be modified directly, and it needs to rely on a third-party application or browser.

ChromeRemoteDesktopusesport443(HTTPS)astheprimaryportforsecureconnections,andoccasionallyport80(HTTP)asafallback.ItalsoleveragesSTUN,TURN,andICEprotocolstoestablishpeer-to-peerconnections,withTURNactingasarelayifdirectconnectionsfail.Toensuresmoothop

Chrome's incognito browsing history cannot be viewed directly, but it can be obtained indirectly through three methods. 1. Use command line tools to view the DNS cache, which can only obtain some domain name information and is not durable; 2. Check the router or network monitoring log, which requires certain network knowledge and depends on network settings; 3. Install third-party monitoring tools and configure in advance to record invisible browsing behavior. Overall, the invisibility mode is designed to protect privacy. All the above methods have limitations. It is recommended to choose whether to use monitoring methods based on actual needs.

There are several ways to force exit from unresponsive Chrome on your Mac. First, use the keyboard shortcut Command Option Esc to open the "Force Exit Application" window, select Google Chrome and click "Force Exit". Second, click on the Apple menu, select "Force Exit", and select Chrome from the list and confirm quit. If Chrome completely freezes or consumes too much memory, you can open ActivityMonitor, find all Chrome-related processes, and click the X button one by one to end them. Finally, as an alternative, you can enter killallGoogle\Chrome in Terminal

To test page behavior in different time zones in Chrome, there are three ways to do it. 1. Use ChromeDevTools to simulate the time zone: Open DevTools → Click on three points → MoreTools → Sensors, check the overlay option in the DateandTime section and select the target time zone. This setting only takes effect in the current session; 2. Specify the time zone through the command line startup parameters: close all Chrome instances and execute chrome.exe--timezone="target time zone" to affect the entire browser instance; 3. Use JavaScript to overwrite the behavior of the Date object, and the fixed time value is used to accurately control the JS time.

There are four ways to turn off Microsoft Edge backend running. 1. Disable background running in Edge settings: Go to "Settings" → "System" and turn off the "Run Microsoft Edge in the background" option. 2. Close Edge in Windows startup item: Through the "Startup" tab of Task Manager, right-click Edge and select "Disable". 3. Modify the group policy or registry: Advanced users can create BackgroundModeEnabled registry key and set it to 0, or use the official group policy template. It is recommended to back up the system before operation. 4. Use Task Manager to manually end the process: temporary emergency plan, press Ctrl Shift Esc to open the Task Manager to end all Es
