-
Notifications
You must be signed in to change notification settings - Fork 43
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
feat(theme-default): image alt option and set aria hidden on title if same as image alt (close #20) #23
feat(theme-default): image alt option and set aria hidden on title if same as image alt (close #20) #23
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Answer the 2 question first before solving the other one.
I would say no to this PR at the moment, and I believe changing the logo alt to empty string is enough.
I disagree that built-in accessibility scanners is all that should be used. Deque does a vast larger amount of testing and research then Google or Microsoft does. They are setting the standards that Google and Microsoft use and so will appear to be pushing the standard, because they are. When they add best practices its because they think and are trying to make it a standard. In the case of landmarks not being unique it is a problem for screen readers, not just a best practice. You can see an example here where when a screen reader is performing landmark navigation there are multiple landmarks that just say "navigation". This is before getting into any contents of each navigation instance. Yes, the nest page and previous page links should have screen readable labels but that is a separate concern. |
Also I believe you should send a pr to docs repo. |
…on brand image if not specified
@Mister-Hope Actually, now I remember what the big advantage was having the logo alt read instead of the site title. When viewing the site in a mobile width, the site title is not displayed and thus hidden by screen readers. By having the alt text always on the logo we avoid having to address that scenario explicitly. |
…pty alt on brand image if not specified" This reverts commit 4250903.
Documentation PR created at vuepress/docs#10 |
Good point, that makes sense |
Before submitting the PR, please make sure you do the following
close #123
).What is the purpose of this pull request?
Description
Dequeue/Axe recommends not to include alt text on an image that is also already displayed next to it. A screen reader will then read it twice.
https://dequeuniversity.com/rules/axe/4.8/image-redundant-alt?application=AxeChrome
Currently the brand image in the default theme will also use the site title it displays as the alt text of the brand image.
This PR adds an option to set the brand image alt text to be different from the site title and default to the site title if not set. If the logo alt text and site title are the same then
aria-hidden
is set on the site title so its not read by screen readers.Also, Dequeue recommends all HTML landmarks have a unique role, title or aria-label. If the page is using the auto link page nav there are two nav elements on the page with the same landmark role.
https://dequeuniversity.com/rules/axe/4.8/landmark-unique?application=AxeChrome
This PR adds unique labels to differentiate the navs.
Screenshots
Before
After
closes #20
closes #21