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.

[Feature Request] Add a class to a top level HTML element to identify Dark Reader style applied

See original GitHub issue

I was thinking more about our discussion on allowing the user to edit the dynamic or other themes for user-specified sites.

I think it’s a very worthwhile long-term goal. In the short-term, I have a proposal that is easy to implement while simultaneously providing maximum flexibility: Add a class to a top level HTML element (such as body) that identifies the Dark Reader style being applied (dynamic, filter, filter+, custom01, custom02, etc.).

This simple improvement allows the user to apply any additional styles (or other functionality, such as scripts) they want, dependent on the Dark Reader theme being applied. People can apply those styles using userContent.css, Stylish, or whatever they prefer.

This other project already performs this class-adding behavior, and as you can see, the implementation is rather simple: https://github.com/codebicycle/videospeed

The only hiccup I can think of right now is ensuring that the user-override styles are able to override any Dark Reader CSS that uses !important.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Gustedcommented, Mar 11, 2021

@Gusted Thank you! Has #4860 been pushed to release yet?

Checks status of #4860 >> Open

2reactions
Gustedcommented, Feb 23, 2021

#4860 Not sure how I’ve missed these 2 notifications.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help – Dark Reader
Open chrome://extensions page, find Dark Reader, click Allow access to file URLs. Entire website is not displayed in Filter mode. If you are...
Read more >
How To Select HTML Elements Using ID, Class, and Attribute ...
In this tutorial, you will use the id , class , and attribute selectors to scope styles to intentionally written HTML. You will...
Read more >
A Complete Guide to Dark Mode on the Web - CSS-Tricks
Dark mode” is defined as a color scheme that uses light-colored text and other UI elements on a dark-colored background. Dark mode, dark...
Read more >
Selectors - W3C
In CSS, pattern matching rules determine which style rules apply to elements in the document tree. These patterns, called selectors, may range from...
Read more >
Cascade, specificity, and inheritance - Learn web development
The rule that's styling your element may not be the one you expect, ... the class selector main-heading gives its rule a higher...
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