firefox ignores userContent.css and user.js text selection highlight in background, and the green value is barely visible, vast inferior to anything in the market
Categories
(Core :: Layout: Text and Fonts, defect, P3)
Tracking
()
People
(Reporter: wwang200112, Unassigned, NeedInfo)
References
Details
Attachments
(1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:152.0) Gecko/20100101 Firefox/152.0
Steps to reproduce:
firefox ignores userContent.css and user.js text selection highlight in background, and the green value is barely visible, vast inferior to anything in the market
try this in userContent.css
@media (prefers-color-scheme: light) {
:root {
--color-accent-primary: #2656c9 !important;
--color-accent-attention: #4766cb !important;
--text-color-accent-primary-selected:#ffffff !important;
}
}
@media (prefers-color-scheme: dark) {
:root {
--color-accent-primary: #aec6f6 !important;
--color-accent-attention: #17379d !important;
--text-color-accent-primary-selected: #000 !important;
}
}
::selection {
background: var(--color-accent-primary) !important;
background-color: var(--color-accent-primary) !important;
color: var(--text-color-accent-primary-selected) !important;
}
var, ::selection, every single one of them is ignored.
try below in user.js
user_pref("ui.textSelectBackground", "#4766cb");
it's again ignored
Actual results:
nothing works except author css injected from tampermonkey
Expected results:
can mozilla do NOT override the text selection colors have those hard coded for page with dark background?
and if it must be overridden just because "think different", can mozilla use a value that provides a contrast level following w3c guideline instead of this horrible greenish tint? a barely visible color forced upon user is "thinking inferior" not "different"
Comment 1•3 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Layout: Text and Fonts' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•3 months ago
|
||
Hi, thanks for reporting. Could you share with us which page is giving you this green highlight?
you can try wikipedia and github toggle light dark theme.
or, literally anything where the page in "dark mode"(whether the page does media query affect that or not)
and the light theme isn't applying the usercontent.css ::selection either. it's just the default not as bad.
Comment 4•3 months ago
|
||
That's very strange - I was able to:
- Create a new profile from
about:profiles - Set
toolkit.legacyUserProfileCustomizations.stylesheetstotrueinabout:config - Go to
about:support - Click "Open Directory" for "Profile Directory"
- Create
chromedirectory - Create
userContent.cssunder the newchromedirectory - Paste content from comment 0
- Restart browser with the new profile
And I can see that the selection color does indeed change to a light bluish color. Could you confirm that this works on your end? Perhaps an extension is overriding the highlight color?
Comment 5•3 months ago
|
||
The severity field is not set for this bug.
:TYLin, could you have a look please?
For more information, please visit BugBot documentation.
Comment 6•2 months ago
|
||
Ah, so this is because these flags only look at author (not user) sheets... Maybe we should treat user rules like author rules for most purposes here, I think that'd be fine.
Comment 7•2 months ago
|
||
So... There are different things going on here.
- First, what's your selection color? On windows text selection should always be white-on-blue generally. Can you attach a screenshot?
- The default text selection color is changeable via
ui.highlight/ui.highlighttextprefs. - But it should never be green? The only green we use is for find-in-page afaict.
Could you clarify / post screenshots of the behavior you get on a clean profile?
Comment 8•2 months ago
|
||
The new names are a bit of a mouthful but this should be fine-ish...
Would need a test, but I think I want to get to the bottom of this /
this should probably land on a separate bug.
Updated•2 months ago
|
Comment 9•7 days ago
|
||
Comment on attachment 9605050 [details]
WIP: Bug 2048483 - Allow user CSS to override native theming.
Revision D310810 was moved to bug 2075979. Setting attachment 9605050 [details] to obsolete.
Description
•