I have in the past used !important to ensure that certain utility classes are honored - like a .visually-hidden utility. It's probably overkill in codebases you can 100% manage, but if you're trying to help a client get the hang of screen-reader-only content, using !important miiiiiight make sense.
Great article, Kayla! Thanks for writing (and motivating me to make an account here!).
Definitely! I've gotten spoiled by Bootstrap's .sr-only and .sr-only-focusable classes, so using it for a visually hidden element slipped my mind. Improving accessibility is always a more than valid use case.
Thanks again! And it's no problem!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have in the past used
!important
to ensure that certain utility classes are honored - like a.visually-hidden
utility. It's probably overkill in codebases you can 100% manage, but if you're trying to help a client get the hang of screen-reader-only content, using!important
miiiiiight make sense.Great article, Kayla! Thanks for writing (and motivating me to make an account here!).
Definitely! I've gotten spoiled by Bootstrap's
.sr-only
and.sr-only-focusable
classes, so using it for a visually hidden element slipped my mind. Improving accessibility is always a more than valid use case.Thanks again! And it's no problem!