Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark theme support in embedded options pages fix #35778

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

rebloor
Copy link
Contributor

@rebloor rebloor commented Sep 6, 2024

Description

Adds a release note and updates the options UI page with details of the updated favorite colors example and note about the addition of <meta name="color-scheme" content="dark light" /> to support automatic theme switching. Provides documentation for Bug 1888866 Addons options_ui browser_style false doesn't properly handle dark mode on macOS

Related issues and pull requests

The corresponding change to the favorite colours example is in mdn/webextensions-examples#567

@rebloor rebloor added the Content:WebExt WebExtensions docs label Sep 6, 2024
@rebloor rebloor requested a review from Rob--W September 6, 2024 17:48
@rebloor rebloor self-assigned this Sep 6, 2024
@rebloor rebloor requested review from a team as code owners September 6, 2024 17:48
@rebloor rebloor requested review from pepelsbey and removed request for a team September 6, 2024 17:49
@github-actions github-actions bot added Content:Firefox Content in the Mozilla/Firefox subtree size/xs [PR only] 0-5 LoC changed labels Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

Preview URLs

External URLs (1)

URL: /en-US/docs/Mozilla/Firefox/Releases/127
Title: Firefox 127 for developers

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could be even better by linking the relevant documentation. Could you add the following enhancement? Feel free to merge this PR and create a new PR for the change in web documentation.

@@ -39,6 +40,8 @@ To create an options page, write an HTML file defining the page. This page can i
</html>
```

Note the use of `<meta name="color-scheme" content="dark light">`. This enables automatic switching between light and dark themes in the embedded UI based on the user's browser preferences.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you link to MDN documentation for this?

Unfortunately I cannot find an easy main article for this. The meta tag is currently documented at:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name

Could you copy paste that to a new article under https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/color-scheme and interlink this new article and https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme to make it easier to find the two articles?

(Since the article content is so large, instead of copying, you could also trim some content in the original article to make the list of meta names more digestible).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rob--W as that content seems to fall outside my bailiwick, I've created #35801 (so the resulting changes can be reviewed by appropriate SMEs)

@rebloor rebloor merged commit a3f3d02 into mdn:main Sep 9, 2024
7 checks passed
@rebloor rebloor deleted the dark-theme-support-fix branch September 9, 2024 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Firefox Content in the Mozilla/Firefox subtree Content:WebExt WebExtensions docs size/xs [PR only] 0-5 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants