Twitter Now Autoswitches To Dark Mode Based On Your OS Settings
If Twitter is suddenly using a dark mode theme, you are not alone. Starting yesterday, Twitter automatically switched to a dark or light theme based on your operating system settings.
When switching to a dark mode based on your OS settings, Twitter will use the ‘Lights Out’ theme, which uses the black color for the site’s background, as shown below.
This new auto-dark mode feature appears to be only working Chromium-based browsers such as Google Chrome, Microsoft, Edge, and Brave.
To control this feature, Twitter uses the ‘prefers-color-scheme’ CSS media query that allows web sites to modify a page’s theme and layout based on the operating system’s preferences.
For example, in the code below, you see how Twitter checks whether the computer is configured in a dark theme, and if it is, changes the background color of the page to black (#000000).
How to force Twitter to use light mode
This new feature is a little buggy, as it breaks if you go into your Twitter settings and change the display preferences.
For example, once I went to the Twitter display settings, located at More -> Settings and Privacy -> Accessibility, display, and languages -> Display, and changed my preference to Default, the site will no longer automatically switch between themes.
For those who do not like the new dark mode setting, you can perform the above steps and set your background to ‘Default’ or ‘Dim’ to get back to the normal Light and Dark themes.
BleepingComputer has contacted Twitter about the feature but has not heard back as of yet.