Skip to content

Instantly share code, notes, and snippets.

@rhewitt22
Created November 17, 2014 16:06
Show Gist options
  • Save rhewitt22/794951b03d41db29c048 to your computer and use it in GitHub Desktop.
Save rhewitt22/794951b03d41db29c048 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<a href="#" class="button">Default</a>
<a href="#" class="button-confirm">Confirm</a>
<a href="#" class="button-warning">Warning</a>
<a href="#" class="button-alert">Alert</a>
// ----
// Sass (v3.4.7)
// Compass (v1.0.1)
// ----
@import "compass";
$confirm: #46881c;
$warning: #F7D137;
$alert: #CC181E;
%btn {
@include border-radius(7px);
@include unstyled-link;
font-weight: bold;
display: inline-block;
padding: .5em 1em;
}
@mixin my-button($bg-color: #006EBE) {
@extend %btn;
color: $bg-color;
border: 4px solid $bg-color;
&:hover {
color: white;
background-color: tint($bg-color, 10);
border: 4px solid shade($bg-color, 10);
}
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, "Sans serif";
}
.button {
@include my-button;
}
.button-confirm {
@include my-button($confirm);
}
.button-warning {
@include my-button($warning);
}
.button-alert {
@include my-button($alert);
}
.button, .button-confirm, .button-warning, .button-alert {
-moz-border-radius: 7px;
-webkit-border-radius: 7px;
border-radius: 7px;
color: inherit;
text-decoration: inherit;
cursor: inherit;
font-weight: bold;
display: inline-block;
padding: .5em 1em;
}
.button:active, .button-confirm:active, .button-warning:active, .button-alert:active, .button:focus, .button-confirm:focus, .button-warning:focus, .button-alert:focus {
outline: none;
}
body {
font-family: "Helvetica Neue", Helvetica, Arial, "Sans serif";
}
.button {
color: #006EBE;
border: 4px solid #006EBE;
}
.button:hover {
color: white;
background-color: #197cc4;
border: 4px solid #0063ab;
}
.button-confirm {
color: #46881c;
border: 4px solid #46881c;
}
.button-confirm:hover {
color: white;
background-color: #589332;
border: 4px solid #3f7a19;
}
.button-warning {
color: #F7D137;
border: 4px solid #F7D137;
}
.button-warning:hover {
color: white;
background-color: #f7d54b;
border: 4px solid #debc31;
}
.button-alert {
color: #CC181E;
border: 4px solid #CC181E;
}
.button-alert:hover {
color: white;
background-color: #d12f34;
border: 4px solid #b7151b;
}
<a href="#" class="button">Default</a>
<a href="#" class="button-confirm">Confirm</a>
<a href="#" class="button-warning">Warning</a>
<a href="#" class="button-alert">Alert</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment