theme-toggles icon indicating copy to clipboard operation
theme-toggles copied to clipboard

Change prefers-reduced-motion media query to no-preference

Open joppekroon opened this issue 2 years ago • 1 comments

It is great that the animations don't work when the user has indicated that they prefer no motion. However the even better practice is to only have animations when the user has indicated that they have no preference with respect to motion.

Great:

@media (prefers-reduced-motion: reduce) {
  /* Disable all the animations */
} 

Better:

@media (prefers-reduced-motion: no-preference) {
  /* All the animation code */
}

This is a safer default as users that are affected by motion and are on a system on which they cannot indicate this preference, will not have the motion applied and thus will not experience any ill effects.

It is also arguably a simpler approach, as all the animation code will be sequestered into the media query, as opposed to the animation code having to be disabled.

joppekroon avatar Feb 24 '23 10:02 joppekroon

Thanks for the suggestion. I like this a lot and will add it into the next version. I don't have a release date yet but development is very far along so it wont be long

AlfieJones avatar Feb 27 '23 11:02 AlfieJones