Skip to content

Instantly share code, notes, and snippets.

@MattOnyx
Created August 1, 2020 21:54
Show Gist options
  • Save MattOnyx/6cc3d54154c76cb88e7483d4da303929 to your computer and use it in GitHub Desktop.
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
/* 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