Flavio Copes
Read post

@keyframes and prefers-reduced-motion done right

A practical guide to building CSS keyframe animations correctly, covering the fade-up pattern using only transform and opacity for GPU-friendly performance. Explains fill modes (why 'both' is almost always what you want), per-keyframe timing functions for realistic motion like bouncing, and how to properly implement prefers-reduced-motion — including the nuance that 'reduced' means replacing motion with opacity fades rather than simply disabling all animation. Also warns about the pitfall of animation: none breaking elements that rely on fill-mode: forwards for their final visible state.

    #css#accessibility
Yesterday•5m read time•From flaviocopes.com
Post cover image
Table of contents
Building a fade-up, step by stepFill modes: the part everyone gets wrongTiming per keyframeThe accessibility part: prefers-reduced-motionWhat “reduced” should mean
983 Impressions
Flavio Copes's image
Flavio Copes

202 Followers

•

1.1K Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard