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

Add support for the prefers-reduced-motion media feature #1724

Closed
mwdiaz opened this issue Feb 11, 2025 · 0 comments
Closed

Add support for the prefers-reduced-motion media feature #1724

mwdiaz opened this issue Feb 11, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@mwdiaz
Copy link
Contributor

mwdiaz commented Feb 11, 2025

Is your feature request related to a problem? Please describe.
We have React components that rely on a media query to remove/reduce nonessential animations CSS transitions based on this setting, and it would be great if our unit tests for these components could use this as well (especially since it simplifies things like faking timers or waiting for elements to appear/disappear in the DOM).

Describe the solution you'd like
I have a working implementation that we're using locally with pnpm patch and I'm going to submit a PR for that so it can be reviewed and hopefully added to the project.

Describe alternatives you've considered
I have a proposed implementation.

@mwdiaz mwdiaz added the enhancement New feature or request label Feb 11, 2025
mwdiaz added a commit to mwdiaz/happy-dom that referenced this issue Feb 11, 2025
This is modeled after previous work done for `prefers-color-scheme`.
Like `prefers-color-scheme`, I've added this as a device setting that
can be a string, one of "no-preference" (the default) or "reduce".
capricorn86 added a commit to mwdiaz/happy-dom that referenced this issue Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants