Last active
June 21, 2022 11:31
-
-
Save henrik1/b06206d6e79bc07ffcbf1de2add23fee to your computer and use it in GitHub Desktop.
prefers-reduced-motion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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