Skip to content

Instantly share code, notes, and snippets.

@patricksrobertson
Created February 10, 2011 19:20
Show Gist options
  • Save patricksrobertson/821152 to your computer and use it in GitHub Desktop.
Save patricksrobertson/821152 to your computer and use it in GitHub Desktop.
Sassifies the cupid-button done by GIANT ROBOTS. This is really a .scss . Github doesn't recognize it.
//Mixin that allows someone to define Cupid buttons outside of the green colors.
// $main-color: Primary button color.
// $btn-gradient: lighter color to blend with the main color.
// $bottom-border: Darker color for the bottom part of the button.
// $box-shadow: Color for the shadow.
// $text-shadow: Color for the text shadow.
// $text-color: Main color for the text.
@mixin cupid-button($main-color: #7fbf4d, $btn-gradient: #63a62f,
$bottom-border: #5b992b, $box-shadow: #96ca6d, $text-shadow: #4c9021,$text-color: #fff ) {
background: $main-color;
@include cupid-gradient($btn-gradient,$main-color);
border: 1px solid $btn-gradient;
border-bottom: 1px solid $bottom-border;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
@include cupid-shadow($box-shadow);
color: $text-color;
font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif;
font-size: 11px;
font-weight: bold;
line-height: 1;
padding: 7px 0 8px 0;
text-align: center;
text-shadow: 0 -1px 0 $text-shadow;
width: 150px;
}
// Modifies the cupid-button for the active state.
@mixin cupid-button-active($btn-gradient:#5b992b,$bottom-border:#538c27,$box-shadow:#548c29) {
border: 1px solid $btn-gradient;
border-bottom: 1px solid $bottom-border;
@include cupid-shadow($box-shadow);
}
// Modifies the cupid-button for the hover state.
@mixin cupid-button-hover($main-color: #76b347,$btn-gradient: #5e9e2e,$box-shadow: #8dbf67) {
background: $main-color;
@include cupid-gradient($btn-gradient,$main-color);
@include cupid-shadow($box-shadow);
cursor: pointer;
}
// Defines the gradient styles for default and hover states.
@mixin cupid-gradient($start,$end) {
background: -moz-linear-gradient(0% 100% 90deg,$start, $end);
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from($end), to($start));
}
// Defines the shadow behavior for the default, hover and active states.
@mixin cupid-shadow($shadow) {
-moz-box-shadow: inset 0 1px 0 0 $shadow;
-webkit-box-shadow: inset 0 1px 0 0 $shadow;
box-shadow: inset 0 1px 0 0 $shadow;
}
// cupid button implemented in green
button.cupid-green {
@include cupid-button;
}
button.cupid-green:hover {
@include cupid-button-hover;
}
button.cupid-green:active {
@include cupid-button-active;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment