Skip to content

Instantly share code, notes, and snippets.

@MichaelArestad
Created September 16, 2014 22:35
Show Gist options
  • Save MichaelArestad/cc99478c4b12387a94d2 to your computer and use it in GitHub Desktop.
Save MichaelArestad/cc99478c4b12387a94d2 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
// Color variables
$darkwing-duck-purple: #582e76;
$launchpad-red: #7e1a03;
// Placeholder selector for @extend
%button {
border-radius: 3px;
font-size: 13px;
}
// Mixin
@mixin button($background: blue) {
@extend %button;
background: $background;
border-color: darken($background, 5%);
}
// Map that sets options
$buttons:(
primary:(
background: $darkwing-duck-purple,
),
secondary:(
background: $launchpad-red,
)
);
// Loopy loop loop
@each $type in map-keys($buttons) {
.button-#{$type} {
$button-color: map-get(map-get($buttons, $type), background);
@include button($button-color);
}
}
.button-primary, .button-secondary {
border-radius: 3px;
font-size: 13px;
}
.button-primary {
background: #582e76;
border-color: #4a2764;
}
.button-secondary {
background: #7e1a03;
border-color: #651502;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment