Urgent.News

What's breaking now, across thousands of outlets.

Tech

OLED Monitors and Dark Mode: Why CSS Inversion Often Beats Your OS Settings

OLED Monitors and Dark Mode: Why CSS Inversion Often Beats Your OS Settings If you have an OLED monitor or OLED laptop screen, you've probably noticed that "true black" matters. OLED pixels that display pure black are literally off — no backlight, zero power, perfect contrast. This is why dark mode on OLED feels so different from LCD. But there's a problem: OS-level dark mode doesn't actually…

When you enable dark mode on an OLED monitor or laptop, you're essentially turning off pixels to display pure black, which results in superior contrast and better battery life. However, this doesn't extend to websites, as they have their own styling that may not support dark mode. CSS inversion is a workaround that forces dark mode on any website, regardless of whether it supports it.

This is achieved by applying the `filter: invert(1) hue-rotate(180deg);` CSS rule to the entire page, effectively turning all colors white and black. While this method works on any site and offers a per-domain toggle, it can result in slightly off colors on sites with unusual color schemes or design-heavy layouts. Browser-level dark mode, on the other hand, controls the appearance of websites but doesn't affect the browser's interface.

It's best to use native dark mode for sites with excellent native dark themes or when color accuracy is crucial. CSS inversion is more effective for documentation sites, news sites, forums, and wikis, as well as any site that ignores prefers-color-scheme. A practical approach is to use browser-level dark mode globally and whitelist specific sites where you prefer native theming. This way, you can enjoy better OLED efficiency and consistent dark mode across most websites.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Thursday 15 October →