Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

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

How to set css for selection background in mailnews and editor views

  • 2 replies
  • 0 have this problem
  • 33 views
  • Last reply by mozcrash1

more options

Thunderbird 128.9.2esr (64-bit) openSUSE Tumbleweed

How do I change the ::selection background css for text that appears in the mailnews reader and editor views? I am happy to use userChrome.css or userContent.css. Currently the selected background is too dark against my chosen dark background color. I simply need to lighten it a bit. I've been through the about:config pages looking at "color" and there isn't a setting I can find. So it appears I will need to use CSS in userChrome.css to accomplish this. I need to know what the magic incantation is to do this. I get it will involve the ::selection pseudo-element, but which tag to apply it to, any special namespace? All?

An example of the selection color I am talking about is shown in this image (attached)

Preferably, this solution should continue to work when openSUSE updates to 136/7, etc..

Thunderbird 128.9.2esr (64-bit) openSUSE Tumbleweed How do I change the ::selection background css for text that appears in the mailnews reader and editor views? I am happy to use userChrome.css or userContent.css. Currently the selected background is too dark against my chosen dark background color. I simply need to lighten it a bit. I've been through the about:config pages looking at "color" and there isn't a setting I can find. So it appears I will need to use CSS in userChrome.css to accomplish this. I need to know what the magic incantation is to do this. I get it will involve the ::selection pseudo-element, but which tag to apply it to, any special namespace? All? An example of the selection color I am talking about is shown in this image (attached) Preferably, this solution should continue to work when openSUSE updates to 136/7, etc..
Attached screenshots

Chosen solution

Add this to userContent.css:

::-moz-selection {
  color: red;
  background: yellow;
}


https://www.w3schools.com/howto/howto_css_text_selection.asp

Help/Troubleshooting Info, Profile Folder, Open Directory (Win: Folder), close TB, create a new folder named chrome, create a new document in chrome with a text editor, name it userContent.css, Save as type: All files *.*, copy in the above code, change the colours as desired. Double-click toolkit.legacyUserProfileCustomizations.stylesheets to true in Settings/General/Config. editor, restart TB.

Online css generator

video on how to create a css file (Firefox and TB)

Read this answer in context 👍 1

All Replies (2)

more options

Chosen Solution

Add this to userContent.css:

::-moz-selection {
  color: red;
  background: yellow;
}


https://www.w3schools.com/howto/howto_css_text_selection.asp

Help/Troubleshooting Info, Profile Folder, Open Directory (Win: Folder), close TB, create a new folder named chrome, create a new document in chrome with a text editor, name it userContent.css, Save as type: All files *.*, copy in the above code, change the colours as desired. Double-click toolkit.legacyUserProfileCustomizations.stylesheets to true in Settings/General/Config. editor, restart TB.

Online css generator

video on how to create a css file (Firefox and TB)

Helpful?

more options

Thank You!

The ::-moz I wouldn't have found, just from lack of familiarity of the tbird internals post ver. 3.x when the version race took off. Already had toolkit.legacyUserProfileCustomizations.stylesheets set true and had a userChrome.css and created the new userContent.css. Finally the dark theme is tweaked to my aging eyes aren't straining to see which character the selection begins on.

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.