PSA: I called `!important` lazy CSS for years, then a client site in Dallas changed my mind
I spent years telling anyone who would listen that `!important` was a hack for people who did not understand specificity, then last month I had to patch a third party checkout widget on a site that loads 40 other stylesheets and it was the only fix that held. Now I am split: is slapping `!important` on it a real fix or just hiding a mess? Curious where everyone lands on this.
Small thing, but `!important` is not the only fix that holds on third party widgets. Specificity still wins over it, so a selector like `.checkout-widget .field input` with `!important` on it will lose to something more specific that also has `!important`. The cleaner move in that case is to scope your override tighter, or load your stylesheet after theirs and bump the selector weight instead of forcing it. Where `!important` does earn its keep is when you cannot see or control the other stylesheet at all, like a widget from a vendor that updates on its own schedule. So it is less "lazy vs real fix" and more "did you try scoping first." In my experience the Dallas patch was probably fine, but check that it is not just masking a load order problem.