-
Notifications
You must be signed in to change notification settings - Fork 683
Add accName to icon buttons, implement error icon when button doesn't have an accessible name #18233
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
base: 6.x
Are you sure you want to change the base?
Conversation
…accessible name is present on button component
…anded state is updated; in navigation, reference text slot in accessible name for toggle button
|
I updated the styles a bit to hopefully make these issues stand out a bit more
Other than that, looks good! I'm curious if we'll end up seeing a performance hit from calculating the computed name whenever the button renders, but I feel like we can just keep an eye on it. If we do, I'm curious if we could just include something like a11y.css and have a way to toggle it easily to achieve a similar goal without the same overhead. |
That looks great, @brianjhanson! I updated the styles to use some of the new color tokens that meet contrast. I initially had visually-hidden text inside the button that read We mark the CSS content as decorative ( <span aria-hidden="true" id="global-accName-error"></span> // Hidden visually and — due to `aria-hidden` — only encountered via SR users when it's referenced via `aria-describedby`
<button aria-describedby="global-accName-error"></button> // Button without an accNameThis would have the following benefits:
Thoughts? 🤔
My understanding of a CSS solution like this is that we could technically check to see if the attributes exist, but not necessarily if there is a calculated accessible name. For example, we could only show the error styles if You previously mentioned that we could implement a11y checks like this only when we're in |


Description
craft-buttoncomponent to load, then calculates the accessible name. If no accessible name is found, it updates the button with an error icon.aria-expanded="false", even though the state may have changed toaria-expanded="true"Related issues
Resolves PT-3005, PT-3000, PT-3004