Skip to content

Instantly share code, notes, and snippets.

@CodeMyUI
Created March 9, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CodeMyUI/765bc8b10081e18b304acd1df02168bd to your computer and use it in GitHub Desktop.
Save CodeMyUI/765bc8b10081e18b304acd1df02168bd to your computer and use it in GitHub Desktop.
Button Drop Shadow
<div class="button">
<p>Click me</p>
</div>
@import "color-schemer";
@import "compass";
@import "breakpoint";
@import "susy";
body {
background: #ebebeb;
}
.button {
position: absolute;
left: 50%;
top: 50%;
transform: translateX(-50%) translateY(-50%);
background: #fff;
width: 100px;
padding: 20px 30px;
border: 5px solid #4ac0ee;
color: #4ac0ee;
font-weight: bold;
text-transform: uppercase;
text-align:center;
z-index: 2;
@include transition(all .15s .15s ease-out);
&:after,
&:before {
position: absolute;
width: 100%;
max-width: 100%;
top: 100%;
left: 0;
bottom: -10px;
content: '';
z-index: 1;
@include transition(all .15s .15s ease-out);
}
&:before {
background: #4ac0ee;
top: 10px;
left: -15px;
height: 100%;
width: 15px;
}
&:after {
width:100%;
background: #4ac0ee;
right: 0px;
left: -15px;
height: 15px;
}
&:hover {
background: #4ac0ee;
color: #fff;
margin-left: -7.5px;
margin-bottom: -7.5px;
&:after,
&:before {
top: 100%;
left: 0;
bottom: 0px;
}
&:before {
top: 0px;
left: 0px;
width: 0px;
}
&:after {
right: 0px;
left: 0px;
height: 0px;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment