-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A11y: Add .is-sr-only to helpers #1764
Conversation
|
@Come2Daddy what about |
Sounds good. |
@jgthms What do you think about class naming? |
|
Using
Examples: <p class="has-text-danger">
message here
</p> in this example, we have a message styled by CSS with <p class="has-text-danger">
<span class="is-sr-only">Important </span>
message here
</p> another example: <button class="delete"></button> when screen reader read this button will announce empty button but actually the buttons have an "X" icon but this icon is added by CSS and screen reader read the HTML text so we need to add text for this button: <button class="delete">
<span class="is-sr-only">Close</span>
</button> now SR will annonce the button with close text, so the user now know this button for close action. Note we have another replacement for the latest example by adding <button class="delete" aria-label="close"></button> |
@Come2Daddy @jgthms take a look please 😄 |
@Muhnad I have a question about your examples. What would a screen reader read if you added the aria-label to the danger text? Is there a benefit to using
|
@darylf in your example Screen reader will read the aria-label text only and will ignore the paragraph text. Why does this happen? in your example, the accessible name will be 'Important' not 'message here' because ARIA overrides the HTML the accessible name provided with the native HTML will be overridden by the accessible name provided with ARIA. |
Thanks so much for explaining! |
I notice that is-sr-only-focusable is not in the docs. Has it not been added or not included for any reason. Any ideas? |
Sorry. Should have said why I was interested. I was looking to make use of the skip to main content trick. I found some javascript code - I think from w3c aria site - that is meant to make this trick work, but have not found a way to make it work reliably enough so that a partially sighted user would be able to make sense of what was going on. |
@JohnAherne no you don't need any JS for a skip to content. it all about hiding content from the screen and when using check this skip navigation on webaim |
This is a **new feature **.
Why we need
is-sr-only
?is-sr-only
to hide content visually and keep the screen readers read the content, that's mean the content is accessible to screen readers.