Mitcheljager / svelte-confetti

Confetti in Svelte! Celebrate things with some extra flair. Animates using just HTML and CSS meaning it can work with SSR in SvelteKit!
https://mitcheljager.github.io/svelte-confetti/
265 stars 10 forks source link

No confetti when Windows animations are disabled #9

Closed gutnar closed 7 months ago

gutnar commented 1 year ago

Currently the library decides that the confetti should not be displayed at all when prefers-reduced-motion media selector goes through. I think this decision should be left to the users of the library instead. The main problem is that Windows has this one setting to disable animations that affects a very large set of features and this library not working is quite unexpected behavior in that case.

@media (prefers-reduced-motion) {
  .confetti,
  .confetti::before {
    animation: none;
  }
}
Fortyseven commented 7 months ago

This just bit me in the ass while testing. I turned off Win11 OS animations in the VM since it's a bit sluggish, and spent an hour debugging why this broke. Glad to know it's not ghosts, at least. :sweat_smile:

Mitcheljager commented 7 months ago

Fair enough, I'll change it

Mitcheljager commented 7 months ago

Fixed in 1.4.0. Animations will always show, but animations can be disabled using disableForReducedMotion