tameemsafi / typewriterjs

A simple yet powerful native javascript plugin for a cool typewriter effect.
https://www.npmjs.com/package/typewriter-effect
MIT License
2.49k stars 221 forks source link

Native support for prefers-reduced-motion? #182

Closed JoshuaKGoldberg closed 9 months ago

JoshuaKGoldberg commented 1 year ago

Hi, thanks for this great library! I just discovered it from its usage on https://linkshub.vercel.app. ❤️

From https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion:

The prefers-reduced-motion CSS media feature is used to detect if the user has requested that the system either minimize the amount of non-essential motion used or remove animations altogether, depending on available user preference setting.

It's an accessibility issue to have long-running animations on a page when prefers-reduced-motion is enabled (see https://www.w3.org/WAI/WCAG21/Understanding/pause-stop-hide.html).

What do you think about adding in a prop to the React component to opt into disabling animations when prefers-reduced-motion is enabled?

JoshuaKGoldberg commented 9 months ago

Closing out my old issues for repos I no longer have context on. If anybody has a need for what this issue was asking about, I'd encourage them/you to file a new issue. Cheers!