Skip to content

Instantly share code, notes, and snippets.

@milksense
Created June 5, 2025 14:19
Show Gist options
  • Save milksense/8a122f6362efc6079c3edb46c27e6fa3 to your computer and use it in GitHub Desktop.
Save milksense/8a122f6362efc6079c3edb46c27e6fa3 to your computer and use it in GitHub Desktop.
Reduced Motion in Svelte
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