Fix image carousel accessibility issues #745
Draft
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.
Why
It should be possible to interact with the carousel using a mouse, or keyboard, and visible changes should be communicated to screen readers. It should also be possible to interact with the carousel in high contrast mode.
How
Carousel
aria-label="Image gallery"
andaria-roledescription="Carousel"
to the image/button container to better communicate the carousel element to screen readersCarousel buttons
fill: currentColor
will allow the SVG colour to be updated automatically in high contrast mode so it is visibleProgress / image changes
aria-live="polite"
andaria-atomic="true"
so screen readers announce image details when it changesThumbnail gallery
<ul />
and each image in a<li />
to reflect the semantic structure of the itemsLoad image into gallery viewer.
aria-current="true"
to the list item that corresponds to the image currently being displayed in the carouselTo 🎩
Setup
product > contents > img: false
,product > contents > imgWithCarousel: true
, andproduct > buttonDestination: modal
Product carousel - mouse
Modal product carousel - mouse
Product carousel - keyboard
Modal product carousel - keyboard
High contrast mode