

After some trial and error, I found that adding the following to userContent.css seems to work:
@-moz-document url(about:blank?compose) {
body {
background-color: red;
}
}
Thunderbird’s source code also has some function that reads preferences editor.use_custom_colors and editor.background_color and sets the default color based on those, but it seems that the function is never called. Code rot I guess.


Thanks for the correction. I must’ve overlooked something when looking at how the preferences are loaded. :)
At first, I looked into Thunderbird’s source code and tried to simply identify the element that I could use in userChrome.css. I found that the element is called
#messageEditorin messengercompose.xhtml. However, this doesn’t work because the editor textboxes are apparently iframe-like things that load another website inside them (probably to prevent copypaste injection attacks or something). Even if I added* {background-color: red}in userChrome.css, it couldn’t match the textbox.I figured out the userContent.css way when I opened the debugger in Thunderbird’s developer tools and set a breakpoint in the script that manages the textbox. For example, here’s how to find it for the new calendar event editor:
So the calendar editor lives inside about:blank. However, about:blank is used in lots of places, so it would be good to add some extra conditions instead of changing the background of all about:blank pages used throughout Thunderbird. Luckily, the above picture shows that there’s a link element that can be used as an extra condition like this:
@-moz-document url(about:blank) { html:has(link[href="chrome://messenger/skin/shared/editorContent.css"]) body { background-color: red; } }The tricky part is finding the right code to put a breakpoint into. It helps if you have a local copy of the comm-central source code files (as instructed in Thunderbird docs), since it includes XHTML files for digging around. The new calendar event window is in the somewhat logical path calendar/base/content/item-editing/calendar-item-iframe.xhtml, and the related scripts are right next to it in calendar-item-iframe.js.