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.

can't override outline, marked as important

See original GitHub issue

I am very new to the issues/bug/feature thing, so sorry if i mark it as the wrong thing or if its not the correct place to be posting/asking this.

i wanted to override the outline property of react-selectV2 and couldn’t do it because it is marked as outline : 0 !important

i want to do it with css only, inline styles is not an option for us. this is the style that i used to override the css, but emotion, shows up below my custom css in the index html so i can’t seem to override it.

.react-select__control--is-focused{
    outline:2px dotted  !important;
    outline-offset:1px;
    }

so the first red boundary is my css and the second red boundary is the provided emotion css also, in the screenshot there is no important, because i edited it using chrome devTools, sorry for posting a misleading image. screenshot 2018-12-04 at 8 58 56 am

it would be great if you could consider removing that !important from there or if there is another way to override this using css please inform me about it? Thanks

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:15 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
amaan75commented, Dec 4, 2018

Umm, i actually wrote that because it wasn’t working, so as a workaround i was using focus and blur event to add a new css class to it which would use the outline on the react-select-container. And i just copied the css from the compiled css from scss and that works. But the question still remains is the !important in outline by default really required?

0reactions
bladeycommented, Oct 1, 2020

Thanks for the reply @Rall3n!

@amaan75 if this doesn’t help please let us know and we’ll re-open the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to override !important? - Stack Overflow
Overriding the !important modifier. Simply add another CSS rule with !important , and give the selector a higher specificity (adding an ...
Read more >
CSS !important Property - W3Schools
The only way to override an !important rule is to include another !important rule on a declaration with the same (or higher) specificity...
Read more >
important - CSS: Cascading Style Sheets - MDN Web Docs
Declarations marked as important in the user-agent style sheets override all important declarations in the user style sheets.
Read more >
When Using !important is The Right Choice | CSS-Tricks
The paragraph is will be red, even though the ID selector has higher specificity. The !important rule overrides that particular property.
Read more >
How to Override !important - W3docs
It is possible to override !important, although it isn't recommended to use !important at all. But you can override the !important rule with...
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