Search code examples
cssthunderbirdthunderbird-addonthunderbird-lightning

How can I "hack" the Thunderbird Lightning extension to fully color categories


(Note: While I'm not entirely sure if this be better asked on SuperUser, I guess the fact that you probably will have to mess around in the xpi/jar file with the css settings, should make it suitable for SO.)

Mozilla Thunderbird's Calendar extension, Lightning, will use different colors for different calendars, and just use a narrow vertical bar for the category color: (Light blue as calendar color and red as category color)

enter image description here

What I would like to find out is how I could go about changing/"hacking" the css styles that - surely - must be associated with this, buried somewhere in the plugin directory, so that in the example above, the event would be fully colored red.

Anyone know how to achieve this?


Solution

  • Ten years later, all previous answers are either out-of-date or are too complicated.

    This answer targets the latest Thunderbird (v102.6.0), supports native category colors, and only contains 3 lines of custom CSS.

    Before After
    enter image description here enter image description here

    Please follow the steps below:

    1. Unlock custom CSS as mentioned in this post:

      Goto Tools > Settings > General > Config Editor..., and set toolkit.legacyUserProfileCustomizations.stylesheets to true.

      enter image description here

      enter image description here

    2. Locate your profile folder as mentioned in this post:

      • Windows: %APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\
      • Linux: ~/.thunderbird/profiles/xxxxxxxx.default/
      • Mac: ~/Library/Thunderbird/Profiles/xxxxxxxx.default/

      Create chrome/userChrome.css under the profile folder. For example, the full path for Windows will look like: %APPDATA%\Thunderbird\Profiles\xxxxxxxx.default\chrome\userChrome.css

      Modify chrome/userChrome.css to contain the following CSS:

      .calendar-category-box {
          width: 100% !important;
      }
      
    3. Restart Thunderbird

    4. Change the calendar color to white for better visuals:

      enter image description here

      enter image description here

    5. (Optional) Customize the category colors:

      Goto Tools > Settings > Calendar > Categories and set custom category colors.

      enter image description here

    6. All done!

    In the future, if Thunderbird introduce breaking changes, you may need to slightly modify the CSS based on the inspection results in Tools > Developer Tools > Developer Toolbox.