Last active
August 29, 2015 14:17
-
-
Save besimhu/ec91f6c5a8ddd0e3b384 to your computer and use it in GitHub Desktop.
A simple @each function to loop through a Sass map and generate styles. This is especially handy for when you have and element that reiterates with different settings.
This file contains 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
$brand_colors: ( | |
purple $color-purple, | |
maroon $color-maroon, | |
orange $color-orange, | |
yellow $color-yellow, | |
); | |
.brand-color-bg { | |
@each $color in $brand_colors { | |
&.#{nth($color, 1)} { | |
$brand_color: nth($color, 2); | |
background: rgba($brand_color, 0.8); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment