I am currently doing preliminary research for a project which, if it is feasible, will consist of a Thunderbird extension with Lightning integration. My question is this: How do I use a Thunderbird extension to programmatically change the CSS in Lightning?
Specifically, I want to change the background on the Lightning UI from the normal color to a picture from within my extension -- the idea being that the user downloads the extension, and voila, he has an interesting background. Do you have any idea how I could achieve this?
Update 2022 - MailExtensions
There is a better way to do this with newer versions of Thunderbird.
First of all, you need to create the basic Thunderbird extension layout. This is the same layout as in modern Firefox add-ons, sometimes called WebExtensions. In short, extensions have a
manifest.json
that describe what it does, and additional files referenced from there.In the
manifest.json
, you need to add atheme_experiment
that will allow mapping images and other properties to CSS that applies to the main window. We need to do this since Thunderbird as of version 101 does not have a built-in way to define backgrounds for calendar.Therefore, we want to create a new theme property that allows setting a background image. Here is a full example:
In this manifest we've referenced three files:
addon.svg
is the icon for the extension, style.css is the extra CSS that gets applied to the main window, andwing-rib-1024-768.jpg
will be our background image. The following CSS works at the moment:Put all of these files into one directory and zip them together, then you can install it as an extension. Now, you will have some meat in your calendar.
If you would like to add different CSS, or the CSS above is no longer valid, you can use the Developer Tools' inspector to find the right rules. This works similar to the web developer tools, but for the whole Thunderbird window. You can find it in the Tools menu.
Legacy Extensions
For reference, my original answer from 8 years ago used the legacy extensions format. It worked similarly, but the files were a bit different. These extensions had a chrome.manifest, you need to add a style overlay that overlays chrome://messenger/content/messenger.xul. This will allow you to overlay a CSS file, where you just need to add the right rules. Back then, this was the required CSS:
If you want the images to be in each day box instead, just adapt the rules a bit. I'll leave the week view as an exercise.