Skip to content

Instantly share code, notes, and snippets.

@chriscoyier
Created August 20, 2013 21:03
Show Gist options
  • Save chriscoyier/6287301 to your computer and use it in GitHub Desktop.
Save chriscoyier/6287301 to your computer and use it in GitHub Desktop.
A CodePen by Chris Coyier.
<a href="#0" class="button"><span>Button</span></a>
<a href="#0" class="button"><span>Button</span></a>
<a href="#0" class="button"><span>Button</span></a>
<a href="#0" class="button"><span>Button</span></a>
<a href="#0" class="button"><span>Button</span></a>
@import "compass";
body {
text-align: center;
background: #444;
padding: 1rem;
}
.button {
background: yellow;
display: inline-block;
padding: 2rem 4rem;
margin: 1rem;
text-decoration: none;
font: bold 1rem Sans-Serif;
color: black;
position: relative;
overflow: hidden;
@include transition(0.7s);
&:before {
content: "";
position: absolute;
bottom: -40px;
right: -40px;
width: 10px;
height: 10px;
background: #222;
border-radius: 50%;
@include transition(0.7s);
}
span {
position: relative;
}
&:hover, &:focus {
color: white;
&:before {
width: 270px;
height: 270px;
opacity: 1;
}
}
}
.button:nth-child(1) {
background: #9b59b6;
}
.button:nth-child(2) {
background: #3498db;
&:before {
bottom: auto;
top: -40px;
}
}
.button:nth-child(3) {
background: #e74c3c;
&:before {
right: auto;
left: -40px;
}
}
.button:nth-child(4) {
background: #f1c40f;
&:before {
right: auto;
bottom: auto;
left: -40px;
top: -40px;
}
}
.button:nth-child(5) {
background: #1abc9c;
&:before {
right: auto;
bottom: auto;
left: 90px;
top: -40px;
}
&:hover, &:focus {
&:before {
left: -50px;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment