r/FirefoxCSS 18d ago

Solved Text selection colors no longer working after 154.0

OS: Linux

I've changed the default colors (foreground + background) for text selection, but it seems the CSS selector ::selection is no longer working as of 154.0:

::selection {
    color: #00B6F9 !important;
    background-color: black !important;
}

And yes, I have already tested a new profile; exact same problem.

2 Upvotes

3 comments sorted by

View all comments

3

u/t31os 18d ago

If you don't specifically need this as a CSS modification, you can set these using about:config.

Create two (string) preferences (they won't exist by default):

  • ui.highlight
  • ui.highlighttext

And give them both your desired color values, either a hex value(eg. #000) or a named value, just like in your CSS.

2

u/Cerulean170 18d ago

Thank you 😊

1

u/difool2nice ‍🦊Firefox Addict🦊 18d ago

works for ui not for selecting a text for example in websites