swagger-api / swagger-api/swagger-ui
Accessibility: WCAG 2.3.3 Disable animations for users with reduced motion preferences
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Is your feature request related to a problem?
Motion animations in CSS are not disabled when the media query prefers-reduced-motion is true (i.e., the user has indicated at the OS or some other level that they want animations disabled). The invalid input indicator in "Try it out" in particular has a prominent shake effect.
Describe the solution you'd like
Animations such as "shake" are disabled when prefers-reduced-motion is true.
@media(prefers-reduced-motion) {
.class-typically-animated {
animation: none;
}
}
Describe alternatives you've considered
The media query can be overridden after importing swagger-ui CSS, but this is fragile and the end user depends on the developer of the API to implement it.
Additional context
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the CSS animation rules, especially the shake effect on the Try it out invalid input indicator. Review the prefers-reduced-motion guidance linked in the issue, then verify that animated effects are disabled when that preference is enabled and that the existing behavior remains unchanged otherwise.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- accessibility, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100