NewsCrawler.org

Safari 27.3 beta introduces Adaptive Dark Mode for light websites

Apple has announced Adaptive Dark Mode[1] in Safari 27.3 beta: when a user enables it, Safari adapts light websites and presents them as dark. Safari 12.1 became the first browser to support dark mode on the web in the spring of 2019, yet only 10% of page loads support it, while almost 40% of web page loads come from users in dark mode. To try the feature, users set the system appearance to dark, browse to a website with a bright background and tap 'Try' when Safari offers a preview.

Pages that signal dark mode support with the color-scheme[2] meta tag or a color-scheme: light dark CSS rule are left unchanged; for the rest of the web, Safari quickly analyzes colors to estimate whether a page is predominantly light or dark and adapts light pages to be dark. The transformation is built on a color matrix that inverts the luminosity of colors while preserving hue, making light backgrounds dark and dark text light, with text transformed to meet the WCAG[3] 4.5:1 contrast ratio. Light CSS gradients are transformed to dark, SVG images are inspected and recolored when needed, and pixel histograms of bitmap images are analyzed so simple black-and-white logos can be inverted. Most images are left unchanged, <canvas> content is untouched, and effects like masks and mix-blend-mode[4] are switched off in some cases to avoid undesirable results.

Sites that should stay light can declare the 'light only' color scheme, though the 'only' keyword is not yet supported in Safari 27.3 beta 1. Safari prevents websites from detecting Adaptive Dark Mode: JavaScript that queries CSS colors receives the original authored colors, and images drawn into canvas render in their original form. Newer CSS functions like color-mix() and contrast-color() are available for sites that want full dark mode support, and color-scheme support should be declared in HTML or CSS rather than injected later through JavaScript.

Read the original webkit.orgDiscussion

Discussion

Commenters are split: some welcome the feature, while others want the opposite — an adaptive light mode that turns dark sites light, with a few citing astigmatism — or argue that browsers should display pages as authored and that such behavior belongs in an opt-in setting or an extension. Others bring up the Dark Reader extension and the CSS light-dark() function as existing alternatives.

Sources

Published: First seen: Читать по-русски

Open as a page