Although the use of !important
is typically discouraged due to the complexities it introduces, I believe there is a valid justification for its implementation in the responsive utilities used by TB.
For instance, suppose you need a button to remain hidden on small displays and apply the hidden-sm
class to achieve this. Without using !important, adding the .btn-block
class to make the button block-level on other display sizes could inadvertently cause it to reappear on small displays since setting display back to block overrides the previous hidden property. This conflict arises from the equal specificity of .hidden-sm
and .btn-block
in CSS cascade rules.
In such scenarios, the inclusion of !important
becomes necessary to ensure accurate rendering and prevent unexpected behavior. Nonetheless, your skepticism towards its usage is justified as !important
should always be considered a last resort!