Skip to content

Instantly share code, notes, and snippets.

@zetareticoli
Created October 16, 2013 08:29
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 zetareticoli/7004484 to your computer and use it in GitHub Desktop.
Save zetareticoli/7004484 to your computer and use it in GitHub Desktop.
A Pen by sebastianekstrom.
<a href="#" class="button button-confirm">Confirmation</a>
<a href="#" class="button button-warning">Warning</a>
<a href="#" class="button button-alert">Alert</a>
@import "compass";
@function set-button-text-color($color) {
@if (lightness( $color ) > 40) {
@return black;
}
@else {
@return white;
}
}
%button {
text-decoration: none;
padding: 2em 3em;
width: 30%;
margin: 2% auto;
display: block;
text-align: center;
font-size: 1.5em;
font-family: sans-serif;
font-weight: bold;
@include border-radius(10px);
}
.button {
@extend %button;
}
$button_confirm: green;
$button_warning: #ffc53a;
$button_alert: red;
.button-confirm {
background: $button_confirm;
color: set-button-text-color($button_confirm);
}
.button-warning {
background: $button_warning;
color: set-button-text-color($button_warning);
}
.button-alert {
background: $button_alert;
color: set-button-text-color($button_alert);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment