Skip to content
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

USWDS - Core: Add transition utility with reduced motion preference handling #6268

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

aduth
Copy link
Contributor

@aduth aduth commented Dec 20, 2024

Summary

Animated transitions now respect the system's reduced motion preference. A new transition utility handles default behavior for easing and disabling inessential animation.

Breaking change

This is not a breaking change.

Related issue

Closes #5256

Preview link

In local Storybook, can be previewed at:

Problem statement

As a user who may be distracted or experience harm such as nausea due to animated content, I expect that the U.S. Web Design System will respect my preference to experience reduced motion where possible.

Related:

Solution

Adds a new utility u-transition with smart defaults to handle:

  • Default easing
  • Optional $essential argument (default false) to control whether transition is disabled when reduced motion is preferred

Related:

Testing and review

See "Preview links" above.

Unless system preferences are configured to prefer reduced motion, there should be no changes in the appearance of animated transition effects.

Instructions for configuring reduced motion preference:


Before opening this PR, make sure you’ve done whichever of these applies to you:

  • Confirm that this code follows the 18F Front End Coding Style Guide and Accessibility Guide.
  • Run git pull origin [base branch] to pull in the most recent updates from your base and check for merge conflicts. (Often, the base branch is develop).
  • Run npm run prettier:sass to format any Sass updates.
  • Run npm test and confirm that all tests pass.
  • Run your code through HTML_CodeSniffer and make sure it’s error free.

@aduth aduth requested a review from a team as a code owner December 20, 2024 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USWDS - Feature: Add support for prefers-reduced-motion to disable transitions
1 participant