Skip to content

Instantly share code, notes, and snippets.

@miguelfrias
Created December 4, 2014 16:21
Show Gist options
  • Select an option

  • Save miguelfrias/4b701ad5a54c64ede6e8 to your computer and use it in GitHub Desktop.

Select an option

Save miguelfrias/4b701ad5a54c64ede6e8 to your computer and use it in GitHub Desktop.
One Sass Color to Rule Them All
//http://www.elijahmanor.com/one-sass-color-to-rule-them-all/
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
@mixin Button-theme($colorBase, $colorBorder, $colorShadow) {
background-color: $colorBase;
background-image: linear-gradient(top, $colorBase 0%, $colorBorder 100%);
border: 1px solid $colorBorder;
text-shadow: $colorShadow 0 -1px 1px;
&:hover,
&:focus {
background: $colorBorder;
text-decoration: none;
}
}
%Button {
border-radius: 5px;
box-shadow: inset 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, .3);
color: #fff;
cursor: pointer;
display: inline-block;
height: scut-em(40, 16);
text-align: center;
text-decoration: none;
font-family: 'Open Sans', sans-serif;
font-weight: 700;
line-height: 40px;
padding: 0 15px;
@include Button-theme(#006dcc, #085191, #031b30);
}
.Button {
@extend %Button;
}
.Button--success {
@extend %Button;
@include Button-theme(#5bb75b, #4f904f, #2b4e2b);
}
.Button--danger {
@extend %Button;
@include Button-theme(#da4f49, #bb3a35, #BB3A35);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment