Created
August 25, 2015 02:29
-
-
Save finteractive/b5c56022d9cb91f44b4e 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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
//From http://webdesign.tutsplus.com/tutorials/an-introduction-to-sass-maps-usage-and-examples--cms-22184" | |
/* 2.Multiple Values for Added Awesomeness */ | |
// _m-buttons.scss | |
$buttons: ( | |
error: (#d82d2d, #666), | |
success: (#52bf4a, #fff), | |
); | |
// $buttons: ( | |
// error: (#d82d2d, #666), | |
// success: (#52bf4a, #fff), | |
// warning: (#c23435, #fff), | |
// loading: (#a1a1a1, #ddd) | |
// ); | |
.m-button { | |
// Common Styles | |
display: inline-block; | |
padding: .5em; | |
background: #ccc; | |
color: #666; | |
@each $name, $colors in $buttons { | |
// Sass is strange - Arrays start at 1 not 0! | |
$bgcolor: nth($colors, 1); // Select 1st array | |
$fontcolor: nth($colors, 2); // Select 2nd array | |
// Magic selector appends to name of parent element | |
&--#{$name} { | |
background-color: $bgcolor; | |
color: $fontcolor; | |
} | |
} | |
} | |
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
/* 2.Multiple Values for Added Awesomeness */ | |
.m-button { | |
display: inline-block; | |
padding: .5em; | |
background: #ccc; | |
color: #666; | |
} | |
.m-button--error { | |
background-color: #d82d2d; | |
color: #666; | |
} | |
.m-button--success { | |
background-color: #52bf4a; | |
color: #fff; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment