Today I wondered how someone would reset animations based on the prefers-reduced-motion
property.
I found this link which is very useful but the discussion is ongoing there. The code which I tried works but I'm wondering about the best-practice for this task.
My code:
@media (prefers-reduced-motion: reduce) {
*, ::before, ::after {
animation-delay: -1s !important;
animation-duration: 1s !important;
animation-iteration-count: 1 !important;
background-attachment: initial !important;
scroll-behavior: auto !important;
transition-duration: 0s !important;
}
}
How could this be improved? Is this the best solutions or do I miss something?