Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

userContent.css for message preview pane

more options

Hi,

I would like to try some styling changes to the message preview pane, using userContent.css (or userChrome.css, if that's what's needed). I have enabled toolkit.legacyUserProfileCustomizations.stylesheets, and have successfully altered the style on outgoing (text) mails, following an example I found here. However, I have not been able to make any styling changes to the message (pre)view pane. Is this at all possible? What selectors would I need to, say, change the background color?

A releated question: the 'legacy' in the setting name suggests that support for these customization files is going away. Is there a new, non-legacy way to make these modifications?

Thanks and regards, Gertjan.

Hi, I would like to try some styling changes to the message preview pane, using userContent.css (or userChrome.css, if that's what's needed). I have enabled ''toolkit.legacyUserProfileCustomizations.stylesheets'', and have successfully altered the style on outgoing (text) mails, following an example I found [https://support.mozilla.org/en-US/questions/1311299 here]. However, I have not been able to make any styling changes to the message (pre)view pane. Is this at all possible? What selectors would I need to, say, change the background color? A releated question: the 'legacy' in the setting name suggests that support for these customization files is going away. Is there a new, non-legacy way to make these modifications? Thanks and regards, Gertjan.

Chosen solution

userContent.css

body {font-weight: bold; !important;}

This will use bold font in Message Pane , but it also set bold font in 'Write' window as well.

or more specific .....

    .moz-text-plain,
    .moz-text-plain    pre,
    .moz-text-flowed,
    body { font-weight: bold !important; }
Read this answer in context 👍 0

All Replies (9)

more options

The background color of received plain text messages can be changed in the Colors window in Options/General/Language & Appearance (see picture). To modify the colors for html messages in Dark Mode, there is Darko.

more options

sfhowes said

The background color of received plain text messages can be changed in the Colors window in Options/General/Language & Appearance (see picture). To modify the colors for html messages in Dark Mode, there is Darko.

Thanks, but that answers neither of my questions. The background color I asked about was just an example, I tried to make that clear.

Regards, Gertjan.

more options

The reading pane (basically the same pane as used when you open in a tab) is like a web browser window going to draw the background colour from the HTML email it shows unless that is not specified.

To determine what the pane is called in the CSS, use the developer tools. (ctrl+Shift +I)

more options

I wish I hadn't mentioned this background color... ;-) I had already looked at the developer tools. The reading pane is an element called browser, with id messagepane. The tools also allow adding a style sheet, which I did for experimentation purposes. I added the following style there, hoping to see some change:

 #messagepane body div.moz-text-plain { font-weight: bold !important; }

However, nothing changes. (I tried various selectors here, with various message types.) If I do the exact same thing in Firefox, with an appropriate selector, this works as expected.

Regards, Gertjan.

more options

re : I have not been able to make any styling changes to the message (pre)view pane.

What are the actual changes are you trying to enforce in the 'Message Pane' where you read incoming emails ? Are you only trying to enforce a bold font in Message Pane ?

It would seem you are trying to influence much more than the options as mentioned by sfhowes.

Modified by Toad-Hall

more options

Chosen Solution

userContent.css

body {font-weight: bold; !important;}

This will use bold font in Message Pane , but it also set bold font in 'Write' window as well.

or more specific .....

    .moz-text-plain,
    .moz-text-plain    pre,
    .moz-text-flowed,
    body { font-weight: bold !important; }

Modified by Toad-Hall

more options

Message Pane fonts for received messages are usually set in the Advanced section of Options/General/Language & Appearance. An example of userChrome for the Header Pane (top of the Message Pane) is:

#msgHeaderViewDeck {
  background-color: lightblue !important;
  border-bottom: 0 !important;
}

#compactHeadersBox {
  background-color: lightblue !important;
  border-bottom: 0 !important;
}

The second part is only needed if you use the Compact Headers add-on.

There are further examples here.

more options

Toad-Hall said [...] Thanks, that got me going. (Note that there is a syntax error in your first example: there should be no semicolon between bold and !important. As it turns out, the !important isn't needed here.)

I had a stupid error in my userContent.css; it started with an invalid quote (/ *, note the space), which rendered the first selector invalid.

On top of that, anything I tried in the inspector failed. I found out that, to test out stuff in the message pane, you need to click the three-pane icon in the top right corner. It opens a dropdown; the (for me) third item is the message I'm currently viewing. Selecting that, then (on the style editor tab) clicking the +-icon to add a stylesheet, allows me to enter CSS that is appied to the current message immediately. What I enter there works from userContent.css as well.

What I'm currently doing is mostly for newsgroup messages; I wanted to set a background color for quotes. Something like this works for me:

blockquote[type="cite"], .gmail_quote {
  color: #00c;
  background-color: #eee;
  border-left: none;
  padding-left: none;
}

(I don't know yet if this will make editing a reply less readable.) But mostly I just wanted to play around.

Thanks again, regards, Gertjan.

Modified by Gertjan Klein

more options

sfhowes said

An example of userChrome for the Header Pane (top of the Message Pane) is [...] [...] There are further examples here.

Thanks. The link is informative, and I had not found it. But this is exclusively for the "chrome" part of Thunderbird; the first selector on that link selects everything, and the comment above it explicitly states that the content (viewing pane) is not affected. I did try some stuff in userChrome.css before asking here; this, for example, has an interesting effect: