
How to set css for selection background in mailnews and editor views
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..
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.
video on how to create a css file (Firefox and TB)
Read this answer in context 👍 1All Replies (2)
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.
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.