CSS for input can't be overridden
See original GitHub issueHi there, I have an input inside of a menu Item and because of the !important from the Semantic UI CSS package I am unable to override the padding-right. I’ve tried adding my own custom class to the input and setting padding-right: 0em !important but to no avail.
the CSS I’d like to override:
.ui.icon.input input {
padding-right: 2.67142857em !important;
}
Issue Analytics
- State:
- Created 7 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
css: overriding input[type="text"]
The problem is that pseudo classes count as a class. So [type=text] (a pseudo-class) has equal specificity to .small, and then the width:200px ......
Read more >Find invalid, overridden, inactive, and other CSS
The first thing to do is inspect the element and make sure that your new CSS is actually applied to the element. Sometimes,...
Read more >How to Override CSS Styles
How CSS overriding works, what is the cascading order and inheritance, what are the priorities and some tricks to override them.
Read more >CSS Overriding Variables
When we use var(--blue) inside this selector, it will use the local --blue variable value declared here. We see that the local --blue...
Read more >Specificity - CSS: Cascading Style Sheets - MDN Web Docs
Reduce the specificity of the selector you are trying to override. All these methods are covered in preceding sections. If you're unable to ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@juliehutchinson001 If you can’t modify variables and don’t want to use
!important
, the only way I know is to add multiple times a specific class to add “importance” to your rules. Like you can see in @jlukic example hereYou can get rid of the
!important
here and add lots of.input.input
etc. (or another class ofc)You may need to add a lot of them to override an existing
!important
though, so it’s quite ugly too.If someone have another way to do it, I’m curious too.
@raptoria Exactly, I don’t understand why we should be changing the source code. That is definitely an anti-pattern.
Currently, I’m using Sass as a preprocessor. Is there any way I can do it without using CSS modules?