.sr-only should use !important
Created by: Jakobud
It seems like .sr-only should explicitly use !important
for all attributes. If you are using .sr-only
anywhere, you want ALL of it's attributes to take priority no matter what. There are no exceptions to this.
There are many cases where server side templating logic would add the sr-only
class to an element depending on various conditions. The problem here is that if that element has, for example padding
on it, and this style is defined AFTER you added your Bootstrap CSS to a page, then the sr-only
class is never going to have priority in the cascade, so therefore the padding: 0
that is part of the sr-only
class is going to get overwritten by the padding
on the element that you defined elsewhere. Does that make sense?