Skip to content

Bug-1958596 dark_theme manifest key documentation #39122

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: dark_theme
slug: Mozilla/Add-ons/WebExtensions/manifest.json/dark_theme
page-type: webextension-manifest-key
browser-compat: webextensions.manifest.dark_theme
---

{{AddonSidebar}}

<table class="fullwidth-table standard-table">
<tbody>
<tr>
<th scope="row">Type</th>
<td><code>Object</code></td>
</tr>
<tr>
<th scope="row">Optional</th>
<td>No</td>
</tr>
<tr>
<th scope="row">Manifest version</th>
<td>2 or higher</td>
</tr>
<tr>
<th scope="row">Example</th>
<td>
<pre class="brush: json">
"dark_theme": {
"images": {
"theme_frame": "images/moon.jpg"
},
"colors": {
"frame": "#CF723F",
"tab_background_text": "#000"
}
}</pre
>
</td>
</tr>
</tbody>
</table>

Use the `dark_theme` key to define a static theme to apply when Firefox is using the dark color scheme. The `dark_theme` key uses the same syntax and supports the same image, color, and property objects as the `theme` key.

See the [`theme` key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/theme) for more information.

## Browser compatibility

{{Compat}}

### Chrome compatibility

In Chrome:

- `colors/toolbar_text` is not used, use `colors/bookmark_text` instead.
- `images/theme_frame` anchors the image to the top left of the header and if the image doesn't fill the header area tile the image.
- all colors must be specified as an array of RGB values, like this:

```json
"theme": {
"colors": {
"frame": [255, 0, 0],
"tab_background_text": [0, 255, 0],
"bookmark_text": [0, 0, 255]
}
}
```

The array form and the CSS color form are accepted for all properties.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ These are the `manifest.json` keys; these keys are available in Manifest V2 and
- [commands](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/commands)
- [content_scripts](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_scripts)
- [content_security_policy](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/content_security_policy)
- [dark_theme](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/dark_theme)
- [declarative_net_request](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/declarative_net_request)
- [default_locale](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/default_locale)
- [description](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ browser-compat: webextensions.manifest.theme
</tbody>
</table>

Use the theme key to define a static theme to apply to Firefox.
Use the `theme` key to define a static theme to apply to Firefox. When provided alone, this defines the theme used when Firefox is using either the light or dark color schemes. If the [`dark_theme` key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/dark_theme) key is provided, this key provides the theme used when Firefox is using the light color scheme.

> [!NOTE]
> If you want to include a theme with an extension, please see the {{WebExtAPIRef("theme")}} API.
Expand Down
4 changes: 2 additions & 2 deletions files/en-us/mozilla/firefox/releases/68/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ _No changes._

#### DOM events

- [Firefox for Android](/en-US/docs/Mozilla/Firefox_for_Android) no longer incorrectly sends a {{domxref("Window.resize_event", "resize")}} event until after the first frame is painted; this improves web compatibility with sites that don't expect this event to occur ([Firefox bug 1528052](https://bugzil.la/1528052)).
- Firefox for Android no longer incorrectly sends a {{domxref("Window.resize_event", "resize")}} event until after the first frame is painted; this improves web compatibility with sites that don't expect this event to occur ([Firefox bug 1528052](https://bugzil.la/1528052)).
- The dispatching of events for non-primary mouse buttons has been made to more closely follow the specification; the {{domxref("Element.click_event", "click")}} event is no longer sent when non-primary buttons are clicked, instead using {{domxref("Element.auxclick_event", "auxclick")}}. In addition, {{domxref("Element.dblclick_event", "dblclick")}} no longer fires for non-primary buttons ([Firefox bug 1379466](https://bugzil.la/1379466)).
- The proprietary `mozPressure` property has been deprecated, and will now trigger a warning in the console ([Firefox bug 1165211](https://bugzil.la/1165211)).

Expand Down Expand Up @@ -175,7 +175,7 @@ _No changes._

### Manifest changes

_No changes._
- Support added for the [`dark_theme` key](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/dark_theme). This key enables a static theme to define its looks when Firefox is using the dark color scheme ([Firefox bug 1525762](https://bugzil.la/1525762)).

## See also

Expand Down