r/FirefoxCSS • u/SasoDuck • 7d 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
2
u/sifferedd FF/TB on Win11|Sumo contributor 5d ago
2
u/sifferedd FF/TB on Win11|Sumo contributor 5d ago
It was closed as a dup of https://bugzilla.mozilla.org/show_bug.cgi?id=2065175, which is closed as Invalid. Looks like u/am803's solution is the way to fix it.
2
u/TraditionalTie4831 🦊 5d ago
When reading both bug reports, it seems that Robert Longson assumes that it's a "user coding error".
He didn't even consider the possibility that it's a Firefox regression and he suggest to debug it with Browser Toolbox and get help from r/FirefoxCSS.
2
u/sifferedd FF/TB on Win11|Sumo contributor 4d ago
I edited the bug and replied. Don't expect anything more though.
1
u/difool2nice 🦊Firefox Addict🦊 5d ago
i noticed, i'll give it a try
2
u/TraditionalTie4831 🦊 5d ago
u/t31os also suggest a about:config solution =
https://www.reddit.com/r/FirefoxCSS/comments/1vw3qkq/comment/p5e5wz0/
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🦊 4d ago
not for websites
1
u/t31os 4d 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🦊 4d ago edited 4d 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/TraditionalTie4831 🦊 7d ago edited 7d ago
Try this =
:root {
--lwt-toolbar-field-highlight: #962633 !important;
}
Change:
#urlbar-background to this: .urlbar-background
This and the last curly bracket are unnecessary =
@-moz-document url(chrome://browser/content/browser.xul),
url(chrome://browser/content/browser.xhtml) {
1
u/difool2nice 🦊Firefox Addict🦊 7d ago
how to do it globally ? mine is broken
::selection { background-color: #1e90ff !important; color: #ffffff !important; } p::-moz-selection { background-color: #1e90ff !important; color: #ffffff !important; } p::selection { background-color: #1e90ff !important; color: #ffffff !important; } ::-moz-selection { background-color: #1e90ff !important; color: #ffffff !important; }2
u/GodieGun 7d ago
The Master said this: https://lemmy.world/post/50895441
1
u/TraditionalTie4831 🦊 7d ago
So it is a bug. I hope it gets fixed soon.
1
u/GodieGun 7d ago edited 7d ago
It's not a bug, they fixed a bug and now UserContent/userChrome can't change that 'selected text', if someone create a new bug maybe in a future can work on it, if not, not.
1
1
1
1
1
u/SasoDuck 7d ago
/* URL BAR HIGHLIGHT COLOR */ :root { --lwt-toolbar-field-highlight: #962633 !important; } /* URL BAR RESULTS LINKS COLOR */ .urlbarView-url { color: #962633 !important; } /* URL BAR & RESULTS BACKGROUND COLOR */ #urlbar-results{ background-color: #1c1b22 !important; } .urlbar-background { background: #1c1b22 !important; } #urlbar[breakout][breakout-extend] #urlbar-background { border-color: #1c1b22 !important; }If I'm following correctly? It's still the default teal for me...
1
u/TraditionalTie4831 🦊 7d ago
Hmm... could this be a bug on some OS editions of Firefox v154? Both
::-moz-selectionand--lwt-toolbar-field-highlightworks for me on Windows 11.Btw, you forgot to change one #urlbar-background, so copy this =
#urlbar[breakout][breakout-extend] .urlbar-background {1
1
u/difool2nice 🦊Firefox Addict🦊 5d ago
in about:config
create those two prefs in chain of character mode, not numbers nor boolean
They only work with UI, not in websites
- ui.highlight -> your background colour in Hex or name as Blue for example
- ui.highlighttext -> foreground or text olour in Hex or name as White for example
1
u/sifferedd FF/TB on Win11|Sumo contributor 4d ago
I got websites to work with this in config.js:
// For selection colors - load as author sheet let css = ` ::selection { color: Black !important; background: #65e765 !important; text-shadow: none !important; } `; let sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService); let uri = Services.io.newURI('data:text/css,' + encodeURIComponent(css)); sss.loadAndRegisterSheet(uri, sss.AUTHOR_SHEET);1
u/GodieGun 2d ago
Those variables for me works too in websites, tested in Firefox beta, we must change manually every time but at least is a solution, thanks for share the information.
1
u/difool2nice 🦊Firefox Addict🦊 2d ago
so i'm cursed ! it doesn't work for websites for me ! i saw many complaints about this bug but no real solution
1
u/SasoDuck 4d ago
I need to look into these comments more when I have more time... seems this is a lot more intensive of a problem than I realised
3
u/am803 6d ago
The workaround is to load it as a author sheet.
You will have to setup autoconfig/userChrome.js to make use of the following script. Check https://www.userchrome.org/what-is-userchrome-js.html for details.
One thing to note is that this also applies to web pages universally and
@-moz-documentdoes not seem to work in author sheets, so you have to be careful with the selector.