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

Adding reduced motion media query to disable notification animations. #34

Closed
wants to merge 5 commits into from

Conversation

cbleslie
Copy link

Hey cool React Hot Toast people!

The problem:
Animations are cool. Sometimes; animations are less than ideal for some users. MDN can explain this all the better. Currently React Hot Toast's animations don't obey the reduced motion media query that responds to the user's OS.

How this PR addresses the a11y issue:
On the ToastBar component I have disabled the transitions and animations in the event that prefers-reduced-motion media query is enabled.

Please let me know if this is acceptable. Look forward to your feedback.

@vercel
Copy link

vercel bot commented Jan 30, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/timo/react-hot-toast/7y1NMgdmaDWJpesMQKJMncbwMmhp
✅ Preview: https://react-hot-toast-git-fork-cbleslie-reduced-motion-timo1.vercel.app

@timolins
Copy link
Owner

timolins commented Feb 2, 2021

Great idea, thanks for bringing that up. However, it doesn't seem to work for me on the preview link. Does it work for you?

@cbleslie
Copy link
Author

cbleslie commented Feb 2, 2021

Hey @timolins , Try now. Please ensure you have reduced motion set in your OS settings <3.

@Kilian
Copy link
Contributor

Kilian commented Feb 5, 2021

@cbleslie
Copy link
Author

cbleslie commented Feb 5, 2021

@Kilian It looks good enough for me; Are you good with it?

@timolins
Copy link
Owner

timolins commented Feb 6, 2021

That looks great already! One thing we should sort out is that the missing exit animation, causes them to stack for 1s when they disappear.

image

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.

3 participants