Skip to content

Instantly share code, notes, and snippets.

@henrik1
Last active June 21, 2022 11:31
Show Gist options
  • Select an option

  • Save henrik1/b06206d6e79bc07ffcbf1de2add23fee to your computer and use it in GitHub Desktop.

Select an option

Save henrik1/b06206d6e79bc07ffcbf1de2add23fee to your computer and use it in GitHub Desktop.
prefers-reduced-motion
@media (prefers-reduced-motion: no-preference) {
button {
transition: all 300ms ease-in-out;
border: 2px solid rgba(255,255,255, 0.4);
transform: scale(1);
&:hover {
transform: scale(1.1);
border: 2px solid rgba(255,255,255, 1);
}
}
}
/* Replace it with a safer effect when prefers-reduced-motion returns true */
@media (prefers-reduced-motion: reduce) {
button {
transition: none;
&:hover {
border: 2px solid white;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment