Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
Is there a programmatic way to check whether specific CSS rules are valid or respected by the browser, or it is discarded / less specific?

I am looking for a way in JS to inspect or check current state of CSS rules dynamically at runtime (using browser's reflection feature, possibly) instead of only relying for browser developer's tool to see which rules are "overriden" or filtered. To think an analogy in procedural languages, there's normally a way to check the status or result of each instruction or function that we call (e.g true/false).

.mybutton#submit {
  color: red;
}
.mybutton {
  color: blue;
}

In other words, I am asking if there is an easy way to implement hypothethical is_valid below.

var sheet = document.styleSheets[0];
var rules = sheet.cssRules || sheet.rules;
is_valid(rules[0]); //True
is_valid(rules[1]); //False
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!