Why so many !important css declarations?
See original GitHub issueI need to set some of the basic colors of items to our corporate design system colors.
In 3.x this was not an issue, set up our custom _variables.scss and remap the colors.
But I keep running into roadblocks with classes like .bg-primary or .text-info to name two: these are set in the Bootstrap scss with !important declarations forcing me to redefine the style and also add !important.
Why all the !importantss?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:10 (4 by maintainers)
Top Results From Across the Web
When and why to use the CSS !important declaration
!important in CSS is a special notation that we can apply to a CSS declaration to override other conflicting rules for the matching...
Read more >CSS is !important - Medium
Cascading Style Sheets are designed to, well, cascade. !important declarations overrides the cascading nature of CSS and are often ...
Read more >important - CSS: Cascading Style Sheets - MDN Web Docs
A ! delimiter followed by the important keyword marks the declaration as important. The !important flag alters the rules selecting ...
Read more >Priority of CSS declarations. A smart way to avoid !important
User declarations are the ones that the user of the browser makes, for example, if he changes the default font that the browser...
Read more >Everything You Need to Know About !important CSS ...
An !important declaration that is defined in a user style sheet will have more weight than one defined in an author style sheet...
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 Free
Top 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

Sorry, @smlombardi, but this was the direction we decided to take years ago. We’re kinda locked into it now. Plus, most folks asked us for
!importanton these utilities.They’re there to ensure you can apply those styles as utilities no matter what. It’s a necessary evil that’s only present for utility classes, and nothing else.
You don’t have to rely on the included custom Sass file (I think I’m going to nuke that damn thing at this point, it’s way too confusing).