[Bug] Default user agent style sheet colors all `a` elements.
See original GitHub issueBug Report
Website Address
Not related to a specific page.
Bug Description
An a
element is only a link if it has an href
Attribute. Browsers will not color them if they are not links.
Chrome uses a:-webkit-any-link
to select them by default.
<style class="darkreader darkreader--user-agent">
has a plain a
selector instead of a:any-link
which causes non-links to turn blue.
Steps To Reproduce
Create a new file or go to a site like Codepen and add
<a href="/">A valid link</a><br/>
<a>Not a valid link</a>
Expected Behavior
The element that is not a link is not colored.
Actual Behavior
The element that is not a link is colored.
Screenshots
Without darkreader:
With darkreader:
System Information
- OS: Windows 10
- Browser: Chrome 105
- Dark Reader Version: 4.9.57
Additional Context
None
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to stop user agent stylesheets from overriding my css
The "problem" here is that there is actually no input style in the author stylesheet (see the spec for more info), and therefore...
Read more >* reset overridden by user-agent style sheet in Safari (maybe ...
The user-agent style sheet in Safari (maybe Chrome too) overrides the reset ... We should probably used specific element names instead.
Read more >Improved dark mode default styling with the color-scheme ...
A page in dark mode. Dark mode: Styles specified by the developer and the user agent. The text is white and the background...
Read more >347016 - Support user stylesheets - chromium - Monorail
I just wanted a one line stylesheet to highlight links so my browser is a lot easier to use! A:visited { color: orange...
Read more >Display browser styles in the rule view (UA style sheet rules)
I can see user agent styles from html.css with this patch applied. Note, trying to disable one of them throws this error: TypeError:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s a option, for now just holding off to change that bit of code again and gather some real world tests.
Hi @brunnerh!
Thanks for your bug report, this is indeed a bug and should be solved now. Quite funny that this seems to never really broken any real-world cases.