mapbox / mapbox/assembly

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

Open
#1,029 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2 estimate-2 icebox jira-sync-complete p2
Dominant language
CSS
Stars
138
Forks
26
Avg merge
1d 7h
Merged PRs (30d)
3

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating Assembly's global stylesheet or CSS entry point, since the issue does not name a file. Review Chrome's Auto Dark Theme opt-out guidance, then verify that applying the proposed root-level setting prevents automatic darkening without an existing dark theme; the issue is done when the page opts out consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.