CSS · Intermediate

Respect reduced-motion preferences in CSS

Disable nonessential transitions for visitors who request reduced motion.

Share Email

Use the operating system preference for decorative transitions. Keep state changes understandable without motion:

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

Review commands and snippets before using them in your environment. Examples are not executed by LeafDeft.