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.

Override All Other Styles by using Important:bug

See original GitHub issue

Challenge Override All Other Styles by using Important has an issue. User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36. Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<style>
  body {
    background-color: black;
    font-family: Monospace;
    color: green;
  }
  #orange-text {
    color: orange;
  }
  .pink-text {
    color: pink !important ;
  }
  .blue-text {
    color: blue;
  }
</style>
<h1 id="orange-text" class="pink-text blue-text" style="color: white">Hello World!</h1>

i dont pass the:Your pink-text class declaration should have the !important keyword to override all other declarations.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
Manish-Giricommented, Dec 16, 2016

I’ll work on it…

1reaction
Manish-Giricommented, Dec 20, 2016

@raisedadead I tested the code locally, it looks like the bug doesn’t exist in staging. If you look at this line, the regex does account for possible spaces between !important and ;

code.match(/\\.pink-text\\s*?\\{[\\s\\S]*?color:.*pink.*!important\\s*;?[^\\.]*\\}/g)

Here is the result on my local instance -

screenshot 2016-12-19 18 44 46

screenshot 2016-12-19 18 46 19

Read more comments on GitHub >

github_iconTop Results From Across the Web

Override All Other Styles by using Important:bug #12074
Challenge Override All Other Styles by using Important has an issue. User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 ...
Read more >
Basic CSS - Override All Other Styles by using Important
In today's tutorial we will override all other styles by using important as part of a series on completing the Free Code Camp ......
Read more >
I need an answer for Override All Other Styles by using ...
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36.
Read more >
css - How to override !important?
Overriding the !important modifier. Simply add another CSS rule with !important , and give the selector a higher specificity (adding an ...
Read more >
Override All Other Styles by using Important
Override All Other Styles by using Important. Yay! We just proved that in-line styles will override all the CSS declarations in your style...
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