Dostępność
a11y/carousel-controls
A carousel has named previous and next buttons, a pause button first in its Tab order when it rotates, and stops on hover and focus.
poważnaręczneWCAG 2.2.2, 4.1.2 · Afe-a11y-carousel-toast
Dlaczego
A rotating carousel moves content away while someone is reading it or tabbing into it. Screen reader users hear slides change under them; keyboard users land on links that disappear; slow readers never finish a slide.
Poprawka
Prefer no auto-rotation. If it rotates: a "Pause" / "Play" button that is the first control in the carousel, rotation that stops while the pointer is over it or focus is inside, and a slide wrapper with aria-live="off" while rotating (polite when stopped). Give the container role="region" (or group) with aria-roledescription="carousel" and a label, each slide role="group" with aria-roledescription="slide" and a label such as "2 of 5", and named previous and next buttons.
Przykłady
<section role="region" aria-roledescription="carousel" aria-label="Featured products">
<button type="button" aria-label="Pause rotation">⏸</button>
<button type="button" aria-label="Previous slide">‹</button>
<button type="button" aria-label="Next slide">›</button>
<div aria-live="off">
<div role="group" aria-roledescription="slide" aria-label="1 of 4">…</div>
</div>
</section>Źródła
Fakty
- Identyfikator
a11y/carousel-controls- Waga
- poważna
- Sprawdzanie
- ręczne ocenia człowiek; raport podaje to jako listę kontrolną
- Dotyczy plików
page- WCAG 2.2
- 2.2.2, 4.1.2, poziom A
- Uczy jej skill
fe-a11y-carousel-toastCarousels and toasts- Od wersji
- 0.1.0
Przeczytaj w terminalu
npx github:dawidolko/frontend-skills explain a11y/carousel-controls