Created
June 5, 2025 14:19
-
-
Save milksense/8a122f6362efc6079c3edb46c27e6fa3 to your computer and use it in GitHub Desktop.
Reduced Motion in Svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let isUserPreferringReducedMotion: boolean = true; | |
onMount(() => { | |
window.matchMedia('(prefers-reduced-motion)').addEventListener('change', (e) => { | |
isUserPreferringReducedMotion = e.matches; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment