3 ms·
The important statement is also useful is you're creating something to slap on some other code you have no control over. Examples of this from my experience are
by lopis 5y ago
The important statement is also useful is you're creating something to slap on some other code you have no control over. Examples of this from my experience are:
- debug tools that hijack the pages style
- quickly testing styles on the browser while coding
- widgets that are injected into client's websites; client's websites can be a mess, and might contain important statements themselves...
- browser themes or custom styles
Sometimes it really doesn't matter that! Important is bad practice, if the alternative would be 5x more verbose and confusing. And honestly I don't care what the father of CSS thinks.
- edgyquant 5y agoIt works nicely if you are debugging CSS via the inspector. But if you start slapping important all over the place you eventually converge towards a code base where a majority (or large number) of classes are using important which takes you back to square one.