Course contentsShow
← Web Development
Lesson 552 of 2,9829. CSS Transitions and AnimationsFree lesson

Implementing Reduced Motion Variants

Create alternative animation styles that respect user preferences while maintaining visual feedback.

Implementing Reduced Motion Variants

What you'll learn: How to create alternative animation styles that respect users' motion preferences while still providing visual feedback.


Now that you understand the prefers-reduced-motion media query, it's time to put it into practice. The goal isn't to remove all visual feedback—it's to provide gentler alternatives that won't trigger discomfort for users with vestibular disorders or motion sensitivity.

The Two-Track Approach

Think of it like designing two versions of the same experience: the "full motion" default and a "reduced motion" variant. When prefers-reduced-motion: reduce is detected, you swap out your animations for subtler alternatives.

What to Change

Instead of removing animations entirely:

  • Replace slide/spin animations with simple opacity fades
  • Use instant state changes instead of transitions
  • Shorten animation-duration and transition-duration significantly
  • Reduce rotation and scaling effects

Basic Pattern

.button {
  transition: transform 0.3s, opacity 0.3s;
}

.button:hover {
  transform: scale(1.1) rotate(5deg);
  opacity: 0.9;
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: opacity 0.15s;
  }
  
  .button:hover {
    transform: none; /* Remove scale and rotate */
    opacity: 0.8;    /* Keep subtle feedback */
  }
}

Notice how the reduced motion version still provides hover feedback (opacity change), just without the dramatic movement.

Key Takeaway: Reduced motion variants maintain visual feedback through subtle changes like opacity or color, while eliminating or drastically simplifying animations that involve movement, rotation, or scaling—ensuring accessibility without sacrificing usability.