-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Update a11y.ts #9567
Update a11y.ts #9567
Conversation
…alt and svg title
🦋 Changeset detectedLatest commit: 41024d0 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
The fix looks good to me, although it seems that the rule doesn't check for missing alt
for input
tag with type image, for example.
Should this be implemented in this PR or another? Here's a reference: https://biomejs.dev/linter/rules/use-alt-text/
packages/astro/src/runtime/client/dev-overlay/plugins/audit/a11y.ts
Outdated
Show resolved
Hide resolved
…1y.ts Co-authored-by: Emanuele Stoppa <[email protected]>
Good catch didn't even think about inputs although I don't know why someone would have a |
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.
Logic looks good other than the querySelectorAll
parts!
packages/astro/src/runtime/client/dev-overlay/plugins/audit/a11y.ts
Outdated
Show resolved
Hide resolved
packages/astro/src/runtime/client/dev-overlay/plugins/audit/a11y.ts
Outdated
Show resolved
Hide resolved
packages/astro/src/runtime/client/dev-overlay/plugins/audit/a11y.ts
Outdated
Show resolved
Hide resolved
packages/astro/src/runtime/client/dev-overlay/plugins/audit/a11y.ts
Outdated
Show resolved
Hide resolved
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.
Just a suggestion for your consideration!
message: 'Headings and anchors must have content to be accessible.', | ||
title: 'Missing content', | ||
message: | ||
'Headings and anchors must have an accessible name, which can come from: inner text, aria-label, aria-labelledby, an img with alt property, or an svg with a tag <title></title>.', |
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.
Just checking because I don't think these error messages currently get pulled into docs, so this should be fine. But for docs, we would be using back ticks for inline code formatting on all values, but especially any components like <title>
or else docs will break.
@Princesseuh - tangentially, do we want these dev tool error messages available in docs somewhere? Eventually? We don't really have any "using dev toolbar" docs at all. Is this something we want/care about?
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.
Sorry, missed this message (blame GitHub notifications not working properly since a few weeks 😠). Yes, eventually I would like to have the audits in the docs, similar to the error reference.
It would most likely use JSDoc comments like the error reference do, so the messages would get sanitized etc. (or we'd duplicate every error in the docs, that's ok too)
Co-authored-by: Sarah Rainsberger <[email protected]>
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.
Docs is happy with the changeset!
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.
Looks great, thank you!
Accidentally deleted PR #9507
Closes Issue #9551
Changes
Testing
Manually tested with @examples/blog
Docs