|
[p]
[br][p][br][div align="left"]Web browsers currently handle dark mode in one of two ways. Some of them, like Samsung Browser, simply invert the colors of the web page. This sometimes breaks the site's design, but it works universally. Another approach is to let sites know that dark mode is activated, and let them use an alternative theme. Chrome appears to be joining the latter camp, as the browser's development team announced support the 'prefers-color-scheme' browser feature.[br][/div][div align="center"][br][/div][p]
[br][p][br][div align="left"]The prefers-color-scheme feature was first introduced by Apple, and arrived as part of Safari 12.1 on macOS Mojave. It allows sites to define certain styles for dark mode (for example, turning a white background to black), and when the user's operating system switches to dark mode, those styles are automatically activated. Mozilla has also implemented the feature in the upcoming Firefox 67 release.[/div][div align="left"]The Chrome team announced an 'Intent to Ship' for the feature, meaning development has begun. The post also went into detail about how it would work on different platforms:[br][/div][div align="center"][br][/div][p]
[br][p][br][div align="left"]In short, the feature itself will be supported, but what it evaluates to may vary between platforms and their ability to let the user change the theme.[/div][div align="left"]Supported in Chrome via system setting on Android Q, MacOS, Windows, and via --force-dark-mode on other platforms. There is also a setting in Chrome for Android to override the system setting.[/div][div align="left"]For Android WebView, the 'prefers-color-scheme' media feature will match 'no-preference' when forced darkening is enabled to not have the web content apply dark styles before automatic darkening is applied.[/div][h5]See [a href="https://developer.android.com/reference/android/webkit/WebSettings.html#setForceDarkMode(int" target="_blank"]https://developer.android.com/reference/android/webkit/WebSettings.html#setForceDar[span style="font-weight: bold;"][/span]kMode(int[/a])[/h5][div align="left"]Hopefully, sites will begin to implement their own dark themes in preparation for Chrome adding this feature. When it arrives. [br][br][br][/div][h5][a href="https://www.androidpolice.com/2019/05/02/chrome-will-soon-support-dark-themes-in-websites/" target="_blank"]Sourc[span style="font-weight: bold;"][/span]e[/a][/h5] |
|