4 ms·
Why is there over 1000 !important's in bootstrap.css? I always thought 1 !important was a big no no.
by igotsideas 10y ago
Why is there over 1000 !important's in bootstrap.css? I always thought 1 !important was a big no no.
- mdo 10y agoFolks seemed to expect the `!important`s to always ensure the utility classes are applied properly. https://twitter.com/mdo/status/684261888046190594 https://twitter.com/mdo/status/684261888046190594
- dualogy 10y agoPurism sounds nice in theory, but in practice I have yet to come across a project where at some point an `!important` (or 2) NOT becomes necessary, where it then NOT seems utterly acceptable and in fact fully in line with "the proper natural purpose of !important" (subjectively+situationally perceived, of course) and moreover the only solution to not spend 1-2 weeks refactoring the entire project's very own ad-hoc CSS philosophy/entirety-of-interactions.. (In a framework, different matter quite possibly. Don't they use only-their-own-class-names anyway? Nevermind..)
- efrafa 10y agohttp://csswizardry.com/2016/05/the-importance-of-important/ http://csswizardry.com/2016/05/the-importance-of-important/
- manyxcxi 10y agoContrived example, but one that probably accounts for a LOT of the !importants are utility classes, say .bold. If you put on that class you want to be sure it's getting applied, regardless of the styles which may come before or after it.
- igotsideas 10y agoCould that be avoided if the design of the framework would of kept specificity in mind or does that not matter in that case?
- arcosdev 10y agoIt is, but CSS is also fundamentally broken so whatever