Safari 27.3 adds Adaptive Dark Mode, no code required
WebKit now automatically rewrites light-themed sites into dark mode for users who want it, preserving contrast and letting developers opt out with one CSS declaration.
WebKit announced Adaptive Dark Mode on 3 November, shipping in the Safari 27.3 beta. When a visitor has dark mode switched on at the system level, Safari now automatically rewrites a light-themed page’s colours rather than leaving it stuck in a bright white it was never designed to show in the dark.
The transform works through a colour matrix that inverts luminosity while keeping hue intact, and WebKit targets the WCAG 4.5:1 contrast ratio as it does. It adapts CSS gradients, analyses bitmap images to spot simple logos worth leaving alone, and handles SVGs intelligently, but it leaves canvas content untouched and can disable effects like masks and mix-blend-mode on elements it transforms. Pages that already declare color-scheme: light dark are left alone entirely, and JavaScript has no way to detect whether the transform has been applied.
A site that wants to opt out entirely can do so with one declaration:
:root {
color-scheme: light only;
}
Why it matters: if your site is light-only and has never shipped a dark theme, Safari is about to decide what it looks like in the dark for you. Worth testing against the 27.3 beta now, and worth building a proper prefers-color-scheme dark theme instead if the auto-inverted result looks wrong.
The caveat: WebKit says the only keyword in color-scheme did not work correctly in beta 1, so the opt-out above may not be reliable yet.