Skip to main content

Nice post here about prefers-reduced-motion, which I have also been using more and more often. In addition to CSS, don't forget that you can do it in JavaScript, too.

const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)'); mediaQuery.addEventListener('change', () => {   console.log(mediaQuery.media, mediaQuery.matches);   // Stop JavaScript animation });