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.

CascadingStyleSheet.getAllStyleRules() does not return rules from @media

See original GitHub issue

How can I loop through all the style rules including those from @media ?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
phaxcommented, May 16, 2017

I extracted a common base class that does the handling for the top level rules in a type-safe way. This should resolve the issue also for the future. Thanks again for your input.

0reactions
dalibor-drgoncommented, May 13, 2017

I personally don’t need it, but it may be useful for someone to add getAllStyleRules() to CSSMediaRule. Anyway I just found out, that I need to use CascadingStyleSheet.getAllRules() and filter them manually for my application. Many thanks for support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Find all CSS rules that apply to an element - Stack Overflow
getMatchedCSSRules does NOT show you the final styles that apply to the element. It returns an array of all the CSSStyleRule objects that...
Read more >
CSS Object Model (CSSOM) - W3C
To compare media queries m1 and m2 means to serialize them both and return true if they are a case-sensitive match and false...
Read more >
com.helger.css.reader.CSSReader.readFromString java code ...
Read the CSS from the passed String using a character stream. An eventually contained @charset rule is ignored. Popular methods of CSSReader.
Read more >
At-rules - CSS: Cascading Style Sheets - MDN Web Docs
@media — A conditional group rule that will apply its content if the device meets the criteria of the condition defined using a...
Read more >
CSS @media rule in JavaScript - Arek Nawo
It either provides functionalities that can't be found anywhere else ... The insertRule() method returns the index at which the new CSS rule...
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