Created
April 16, 2014 13:15
-
-
Save BuddyLReno/10873062 to your computer and use it in GitHub Desktop.
Color Switcher with Sass Maps
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
<div class="Brand sc"> | |
<h4>Pop</h4> | |
<h3 class="popBrand">Force Pop</h3> | |
<h4 class="unpopBrand">UnPop</h4> | |
</div> |
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
// ---- | |
// Sass (v3.3.5) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
$brandColorMap: ( | |
bgp: #F74812, | |
sc: #B3752A | |
); | |
@mixin brandColoring ($colorMap: $brandColorMap) { | |
@each $brand, $color in $colorMap { | |
.Brand.#{$brand} { | |
h4:not(.unpopBrand), .popBrand { | |
color: $color; | |
} | |
} | |
} | |
} | |
//USAGE | |
@include brandColoring($brandColorMap); |
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.bgp h4:not(.unpopBrand), .Brand.bgp .popBrand { | |
color: #f74812; | |
} | |
.Brand.sc h4:not(.unpopBrand), .Brand.sc .popBrand { | |
color: #b3752a; | |
} |
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
<div class="Brand sc"> | |
<h4>Pop</h4> | |
<h3 class="popBrand">Force Pop</h3> | |
<h4 class="unpopBrand">UnPop</h4> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment