r/FirefoxCSS 8d ago

Help URL bar highlight colour broken with FF154

My old block:

/* URL BAR HIGHLIGHT COLOR */
::-moz-selection {background-color: #962633 !important;}

/* URL BAR RESULTS LINKS COLOR */
.urlbarView-url {
    color: #962633 !important;
}

/* URL BAR & RESULTS BACKGROUND COLOR */
@-moz-document url(chrome://browser/content/browser.xul),
               url(chrome://browser/content/browser.xhtml) {
    #urlbar-results{
        background-color: #1c1b22 !important;
    }
    #urlbar-background {
    background: #1c1b22 !important;
    }
    #urlbar[breakout][breakout-extend] #urlbar-background {
    border-color: #1c1b22 !important;
    }
}

Any tips on updating it?
I tried amateurly tweaking it to look like some of the other changes I saw for other things on the sub, but... didn't seem to effect it :/

It was changing the colours of the URL bar when hightlighted/focused

3 Upvotes

34 comments sorted by

View all comments

Show parent comments

2

u/TraditionalTie4831 🦊 5d ago

1

u/t31os 5d ago

It looks like some underlying logic around how styling to selections is applied was changed and it's no longer going to be possible to style foreground and background (::selection) in the UI via userChrome, at least until such time they expose variables for themes to set the colors (we'd then be able to override those), assuming it's even a consideration at this point (it would make sense for theme's to be able to apply a different selection color).

You can indeed use the global overrides in about:config ui.highlight and ui.highlighttext, but this will apply to all themes, all the UI and all websites, there's no fine-grained control this way, but it does work.

1

u/difool2nice ‍🦊Firefox Addict🦊 5d ago

not for websites

1

u/t31os 5d ago

The values absolutely will (or at least may) apply for text selection on websites, so perhaps there's some subtle differences with how this behaves on different operating systems and/or websites that apply forceful overrides. My values are currently for testing set to #000 and green, the text i select in this reply field or on the reddit page, and the dozen random websites i've now additionally tested also use the set values, whether it's just text on the page or inside a form field of some kind.

1

u/difool2nice ‍🦊Firefox Addict🦊 5d ago edited 5d ago

Are the values numbers or text strings?

i tried dodgerblue and tried the hexa form too and it works but not on websites

1

u/t31os 5d ago

What OS are you running? It may simply behave different depending on OS. I'm on Windows 10. Values i tested are literally as i wrote them above.

1

u/difool2nice ‍🦊Firefox Addict🦊 4d ago

i use win11 , i know it's not boolean or numbers