Created
August 1, 2020 21:54
-
-
Save MattOnyx/6cc3d54154c76cb88e7483d4da303929 to your computer and use it in GitHub Desktop.
Code sample for my Medium article: You Should Style the Wrong Button State
This file contains 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
/* PULSE EFFECT */ | |
button::before { | |
content: " "; | |
position: absolute; | |
top: 1px; | |
bottom: 1px; | |
left: 1px; | |
right: 1px; | |
border-radius: 10px; | |
background-color: hsla(230, 80%, 80%, 1); | |
opacity: 1; | |
z-index: -1; | |
pointer-events: none; | |
} | |
button:not(:active)::before { | |
transition: all 0.3s ease-out, opacity 0.2s 0.1s ease-out; | |
top: -20px; | |
bottom: -20px; | |
left: -20px; | |
right: -20px; | |
opacity: 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment