Andy-set-studio / modern-css-reset

A bare-bones CSS reset for modern web development.

Home Page:https://hankchizljaw.com/wrote/a-modern-css-reset/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

prefers-reduced-motion transition styles can break JS

atomiks opened this issue · comments

From this comment

The reduced motion CSS will break any functionality relying on the JS “transitionend” event.

https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/transitionend_event

If there is no transition delay or duration, if both are 0s or neither is declared, there is no transition, and none of the transition events are fired.

I think a tiny value like 1ms instead of 0s can fix this.

Interesting stuff! Happy to take a PR!