Change highlight colours with userContent.css

General project discussion.
Use this as a last resort if your topic does not fit in any of the other boards but it still on-topic.
Forum rules
This General Discussion board is meant for topics that are still relevant to Pale Moon, web browsers, browser tech, UXP applications, and related, but don't have a more fitting board available.

Please stick to the relevance of this forum here, which focuses on everything around the Pale Moon project and its user community. "Random" subjects don't belong here, and should be posted in the Off-Topic board.
Goodydino
Keeps coming back
Keeps coming back
Posts: 827
Joined: 2017-10-10, 21:20

Change highlight colours with userContent.css

Unread post by Goodydino » 2024-02-05, 19:13

Operating system: MacOS 13.5.2
Browser version: 33.0
32-bit or 64-bit browser?: 64 bit
Problem URL:
Browser theme (if not default): Darkpitch
Installed add-ons:
Installed plugins: (about:plugins):

Is there any code that I could use to specify the highlight colours with userContent.css? I tried searching for that but was unable to find the name of the element. I know that it can be done from about:config, but my problem is not actually with Pale Moon, but with LibreWolf, which ignores the ui.textSelect settings.

Lucio Chiappetti
Astronaut
Astronaut
Posts: 660
Joined: 2014-09-01, 15:11
Location: Milan Italy

Re: Change highlight colours with userContent.css

Unread post by Lucio Chiappetti » 2024-02-05, 19:17

What is the "highlight colour" ? URL, visited link ? can be set globally in Preferences->Content->Colours, os site-by-ste with NoSquint
Or is something else ?
The reasonable man adapts himself to the world: the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. (G.B. Shaw)

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35651
Joined: 2011-08-28, 17:27
Location: Motala, SE

Re: Change highlight colours with userContent.css

Unread post by Moonchild » 2024-02-05, 19:19

Moved because it's not about Pale Moon.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Blacklab
Board Warrior
Board Warrior
Posts: 1081
Joined: 2012-06-08, 12:14

Re: Change highlight colours with userContent.css

Unread post by Blacklab » 2024-02-05, 19:54

Hmm... apparently "There's an extension for it"... although helpfully the reply gives no name or link... if can find the mystery extension could unpack and see how/what method employed? https://www.reddit.com/r/LibreWolf/comm ... ing_color/

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Change highlight colours with userContent.css

Unread post by Kris_88 » 2024-02-06, 05:03

in about:config create strings:
ui.highlighttext = #ff0000
ui.highlight = #00ff00

This works for normal text selected with the mouse.

U21.png
You do not have the required permissions to view the files attached to this post.

Goodydino
Keeps coming back
Keeps coming back
Posts: 827
Joined: 2017-10-10, 21:20

Re: Change highlight colours with userContent.css

Unread post by Goodydino » 2024-02-06, 18:30

Kris_88 wrote:
2024-02-06, 05:03
in about:config create strings:
ui.highlighttext = #ff0000
ui.highlight = #00ff00

This works for normal text selected with the mouse.


U21.png
That seems to be a bit jerky. It also wants to select only complete words.

Goodydino
Keeps coming back
Keeps coming back
Posts: 827
Joined: 2017-10-10, 21:20

Re: Change highlight colours with userContent.css

Unread post by Goodydino » 2024-02-06, 18:36

Blacklab wrote:
2024-02-05, 19:54
Hmm... apparently "There's an extension for it"... although helpfully the reply gives no name or link... if can find the mystery extension could unpack and see how/what method employed? https://www.reddit.com/r/LibreWolf/comm ... ing_color/
For LibreWolf (takes a Firefox extension), there is an extension called Stylus which can use a stylesheet to change the appearance of content, similar to userContent.css for Pale Moon.

Potkeny
Fanatic
Fanatic
Posts: 132
Joined: 2018-08-03, 17:00

Re: Change highlight colours with userContent.css

Unread post by Potkeny » 2024-02-06, 19:07

Goodydino wrote:
2024-02-06, 18:36
Stylus which can use a stylesheet to change the appearance of content
Sounds like https://addons.palemoon.org/addon/stylem/ ?

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Change highlight colours with userContent.css

Unread post by Kris_88 » 2024-02-06, 19:12

Goodydino wrote:
2024-02-06, 18:30
That seems to be a bit jerky. It also wants to select only complete words.
What do you mean?
So put your colors, I just gave red on green as an example.

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Change highlight colours with userContent.css

Unread post by Kris_88 » 2024-02-06, 19:43

How TO - Change Text Selection Color
https://www.w3schools.com/howto/howto_c ... ection.asp

User avatar
Kris_88
Keeps coming back
Keeps coming back
Posts: 940
Joined: 2021-01-26, 11:18

Re: Change highlight colours with userContent.css

Unread post by Kris_88 » 2024-02-07, 07:56

Firefox supports userContent.css, so LibreWolf should too.
1) In about:config page set
toolkit.legacyUserProfileCustomizations.stylesheets = true
2) Create a "chrome/userContent.css" file in your profile.

Code: Select all

::selection {
  color: red !important;
  background: yellow !important;
}

Goodydino
Keeps coming back
Keeps coming back
Posts: 827
Joined: 2017-10-10, 21:20

Re: Change highlight colours with userContent.css

Unread post by Goodydino » 2024-02-07, 17:50

Kris_88 wrote:
2024-02-07, 07:56
Firefox supports userContent.css, so LibreWolf should too.
1) In about:config page set
toolkit.legacyUserProfileCustomizations.stylesheets = true
2) Create a "chrome/userContent.css" file in your profile.

Code: Select all

::selection {
  color: red !important;
  background: yellow !important;
}
That is the one! That code works. Thanks.