-
-
Notifications
You must be signed in to change notification settings - Fork 78.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
SVG accessibility fixes #27826
Merged
Merged
SVG accessibility fixes #27826
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XhmikosR
reviewed
Dec 12, 2018
- add `focusable="false"` to all SVGs, to stop IE from including the `<svg>` in its default focus cycle - completely hide decorative SVGs using `aria-hidden="true"` - add `role="img"` to meaningful/"content" SVGs, ensure they have an appropriate `<title>` and/or `aria-label` - simplify placeholder default title
- in most cases, no need for separate/redundant text and title (now that we make text itself part of the alternative text explicitly) - no need (expect in rare cirumstances) to describe the placeholder image (unless the look of the image is important/the actual content, as is the case with the image thumbnail class)
- as the `alt` for the placeholder isn't really important, just add an ellipsis instead (otherwise, to be correct, we'd have to construct the whole "title+text" construct like we do now in the placeholder.svg itself
patrickhlauke
force-pushed
the
v4-dev-svg-a11y-fixups
branch
from
December 12, 2018 23:39
8412124
to
451d6e6
Compare
@XhmikosR force-pushed a change, and expanded this PR quite a bit to remove some redundant/overly descriptive text (now that this is constructed from both title and text). also includes changes to SVGO configuration to not remove |
XhmikosR
reviewed
Dec 13, 2018
patrickhlauke
force-pushed
the
v4-dev-svg-a11y-fixups
branch
from
December 13, 2018 11:11
451d6e6
to
b3d986a
Compare
XhmikosR
approved these changes
Dec 13, 2018
…sable=false - regarding `focusable=false`, see svg/svgo#1011 (which would be the "proper" SVGO fix) and the (hacky) solution svg/svgo#817
XhmikosR
force-pushed
the
v4-dev-svg-a11y-fixups
branch
from
December 13, 2018 13:02
b3d986a
to
5dbcdc3
Compare
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
focusable="false"
to all SVGs, to stop IE from including the<svg>
in its default focus cyclearia-hidden="true"
role="img"
to meaningful/"content" SVGs, ensure they have an appropriate<title>
and/oraria-label