Tailwind CSS

tailwind/motion-safe

Decorative Tailwind animations (animate-bounce, animate-ping, animate-pulse) run under motion-safe: or stop under motion-reduce:.

minorstaticfe-tailwind

Why

People with vestibular disorders turn on "reduce motion" because bouncing, pulsing and zooming elements can cause dizziness and nausea. A Tailwind animate-* class ignores that setting unless you ask for it.

Fix

Prefix decorative animations with motion-safe: (motion-safe:animate-bounce), or stop them with motion-reduce:animate-none. A loading spinner (animate-spin) may keep running, since it tells the user something is happening; consider a slower or static indicator under motion-reduce:.

Examples

<!-- bad -->
<span class="animate-ping rounded-full bg-sky-400"></span>
<!-- good -->
<span class="motion-safe:animate-ping rounded-full bg-sky-400"></span>

Sources

Facts

Id
tailwind/motion-safe
Severity
minor
Check
static checked in the source by audit
Applies to
html angular vue svelte astro jsx
Only in projects with
tailwind
Taught by the skill
fe-tailwind Tailwind CSS
Since version
0.1.0

Rule file on GitHub

Read it in the terminal

npx github:dawidolko/frontend-skills explain tailwind/motion-safe