Created
October 6, 2014 18:57
-
-
Save alxjrvs/1d9c96b4e577a3095777 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
$purple: purple; | |
$red: red; | |
$green: green; | |
%button { | |
background: $purple; | |
height: 40px; | |
width: 100px; | |
} | |
$buttons: ( | |
error: ( | |
background: $red | |
), | |
success: ( | |
background: $green, | |
border: '1px solid black' | |
), | |
pending: ( | |
background: $green | |
) | |
); | |
.button { | |
@extend %button; | |
@each $name, $attrs in $buttons { | |
&--#{$name} { | |
@extend %button; | |
@each $attr, $val in $attrs { | |
#{$attr}: #{$val}; | |
} | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.button, .button--error, .button--success, .button--pending { | |
background: purple; | |
height: 40px; | |
width: 100px; | |
} | |
.button--error { | |
background: red; | |
} | |
.button--success { | |
background: green; | |
border: 1px solid black; | |
} | |
.button--pending { | |
background: green; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment