mapbox / assembly

Making the hard parts of designing for the web easy.
https://www.mapbox.com/assembly/
134 stars 27 forks source link

Consider setting color-scheme to opt-out of Chrome Auto Dark Themes #1029

Open katydecorah opened 3 years ago

katydecorah commented 3 years ago

Chrome is working on a new auto dark feature:

Chrome 96 introduces an Origin Trial for Auto Dark Themes on Android. With this feature, the browser applies an automatically generated dark theme to light themed sites, when the user has opted into dark themes in the Operating System. Users can opt-out of dark themes by either disabling the option on the OS level or in a specific setting in Chrome. https://developer.chrome.com/blog/auto-dark-theme/

Since Assembly doesn't currently have a dark-theme (#954), we should consider opting out until we do. Otherwise, we will lose control over how elements are displayed on a user's system if they have dark mode enabled. This could result in poor contrast that renders text difficult to read or UI elements not translating well.

There are a few options to opt out, but I think this option may work best for Assembly:

It is still possible to use this approach to opt-out the entire page from Auto Dark Theme by setting the color-scheme on the :root element:

:root {
 color-scheme: only light;
}

Note: this feature is still being specified, but wanted to get ahead of it https://bugs.chromium.org/p/chromium/issues/list?q=component:Mobile%3EAutoDarkTheme

katydecorah commented 3 years ago

A few examples of Assembly sites with auto dark enabled:

image

image