3 ms·
No way. You are not considering the places where the developer doesn't have access to all the CSS that is happening on the page. !important is a way to override
by exodust 10y ago
No way. You are not considering the places where the developer doesn't have access to all the CSS that is happening on the page. !important is a way to override styles you don't have access to. For example, I've integrated plenty of third party social media widgets in micro-sites, and they often have the capacity to customise the design by adding new CSS, not replacing the untouchable CSS.
Various other scenarios similar to above is not uncommon for frontend developers to find themselves dealing with in the workplace.
- hutzlibu 10y agoJust curious: what happens if they start to use important, too?
- Klathmon 10y agoSometimes I wish you could chain multiple `!important`s, then I realize the horrible idea I just had...
- exodust 10y agoWell of course it's not cool when that happens, and while generally most people agree !important is to be avoided, I was responding to the idea it should be banned completely, or the article where it says it's only good for debugging. It's a last resort that needs to be there, and has probably saved a lot more time than it's wasted.