question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Default user agent style sheet colors all `a` elements.

See original GitHub issue

Bug 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: image

With darkreader: image

System Information

  • OS: Windows 10
  • Browser: Chrome 105
  • Dark Reader Version: 4.9.57

Additional Context

None

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Gustedcommented, Sep 21, 2022

That’s a option, for now just holding off to change that bit of code again and gather some real world tests.

1reaction
Gustedcommented, Sep 17, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found