Skip to content

Instantly share code, notes, and snippets.

@realph
Last active August 29, 2015 14:13
Show Gist options
  • Save realph/bc403c4880cf6a07c52e to your computer and use it in GitHub Desktop.
Save realph/bc403c4880cf6a07c52e to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
<a class="button-pri">Primary Button</a>
<a class="button-sec">Secondary Button</a>
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
$transparent: transparent;
@mixin button-style($bg: $transparent, $color: white) {
background-color: $bg;
color: $color;
@if $bg == $transparent {
box-shadow: inset 0 0 0 1px $color;
}
}
.button-pri {
@include button-style($bg: red);
}
.button-sec {
@include button-style($color: red);
}
.button-pri {
background-color: red;
color: white;
}
.button-sec {
background-color: transparent;
color: red;
box-shadow: inset 0 0 0 1px red;
}
<a class="button-pri">Primary Button</a>
<a class="button-sec">Secondary Button</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment