A Guide to Themes
How to create themes for Thunderbird.
A theme is a Thunderbird add-on that allows to change the appearance of Thunderbird. This document covers the following topics:
Static Themes
Static themes, like the name implies - are static and do not change. They have a set of colors or images that make up the theme, and this does not change. It typically consists of two files, zipped up with an .xpi extension just as any other add-on:
manifest.json
image.png or .jpg
The manifest.json
file
manifest.json
fileYou must prepare a JSON manifest, named manifest.json
just as with other add-ons. Below is a basic example:
The following manifest keys define basic properties:
manifest_version
: A mandatory key defining the Manifest version used by the theme. Supported versions are2
and3
(since Thunderbird Beta 110). The Manifest defines the basic rules how a theme needs to be crafted and how it can interact with Thunderbird.name
: A mandatory key to set the name of the theme.version
: A mandatory key to define a number that denotes the version of the theme.description
: A brief description of the theme.author
: The name of a person or company representing the developer.
The browser_specific_settings.gecko
manifest key defines the following properties:
strict_min_version
: Defines the lowest targeted version of Thunderbird.strict_max_version
: Defines the highest targeted version of Thunderbird. It can be set to a specific version or a broader match to limit it to a branch (for example102.*
). Usually not needed.id
: The id serves as a unique identifier for the theme and is mandatory in order to upload a theme to ATN or to be able to install it from an XPI file.
Although not required by Firefox, Thunderbird requires anid.
Thunderbird does not sign add-ons, and themes will not install without it.
Best practice is to use an "email-address-style" id (but not a real email address) on a domain you control, for example name-of-your-addon@example.com
, if you own example.com
. As the id of your theme cannot be changed once it is published, it is highly recommended to use a domain that you plan to keep for the forseeable future. If you don't have a domain to use, feel free to use:
<atn-user-name>.<add-on-name>@addons.thunderbird.net
\
Alternatively, you may use an UUID enclosed in curly braces, for example:
{e4aa2097-8ee9-49a4-9ec7-c633b1e8dfda}
Additional theme properties
Although the above theme will work as-is, there are other properties which can be added. All currently supported properties are listed in the ThemeType definition in our WebExtension API documentation.
Icons
You can add an icon for your theme, like other types of add-ons, with the following code:
Don't forget to put the icon.png
file in your add-on as well.
A complete example
Here is a manifest.json
from a theme that uses all the above features, thanks to Paenglab:
Dynamic Themes
Dynamic themes are actually normal extensions, that use the update() method of the theme API instead of a static theme manifest key. They can set the same theme properties like static themes, but they can change them dynamically. For instance the Night and Day theme is a dynamic theme that changes the theme colors based on the time of day.
Theming message-compose-windows and message-display-tabs
The built-in theming properties do not modify the message-compose-windows and the message-display-tabs. These can be manipulated by injecting CSS files using the following WebExtension API methods:
To inject the file compose.css
into the message-compose-window, register it in your background script as follows:
Theme Experiments
A theme experiment allows modifying the user interface of Thunderbird beyond what is currently possible using the built-in color, image and property keys of the theme API. These experiments are a precursor to proposing new theme features for inclusion in Thunderbird.
Experimentation is done by exposing already existing internal CSS variables (e.g. --arrowpanel-dimmed
) to the theme API and by loading additional stylesheets to define new CSS variables, extending the theme-able areas of Thunderbird.
Use the browser toolbox to discover CSS selectors for Thunderbird UI elements or internal Thunderbird CSS variables.
Further information regarding theme experiments can be found in our WebExtension API documentation of the theme API.
Our example repository includes an add-on using a theme experiment to change the color of the chat icon.
Last updated