Skip to content

Instantly share code, notes, and snippets.

@parris
Created June 1, 2014 08:44
Show Gist options
  • Save parris/24b0a1a91981028ebf59 to your computer and use it in GitHub Desktop.
Save parris/24b0a1a91981028ebf59 to your computer and use it in GitHub Desktop.
3d button using Bourbon with animations. Demo Here: http://codepen.io/anon/pen/Czlvu
@import '../libs/bourbon/css3/_inline-block';
@import '../libs/bourbon/css3/_transition';
@import '../libs/bourbon/css3/_transform';
@import '../globals';
@mixin flat3DButton($color) {
$inverted_color: invert(mix(invert($color), $color, 25%));
@include inline-block();
background: $color;
color: $inverted_color;
line-height: 2em;
padding: 0 .6em;
box-shadow: 0px 3px 0px #999;
@include transition(all .3s ease-out);
&:hover {
background: lighten($color, 10%);
color: lighten($inverted_color, 25%);
}
&:active {
background: lighten($color, 20%);
box-shadow: none;
@include transition(all .1s ease-in);
@include transform(translateY(3px));
}
}
.button {
@include flat3DButton($color-cta);
font-size: .8em;
}
.button + .button {
margin-left: 1em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment