Last active
August 29, 2015 14:16
-
-
Save RobertShippey/478c57797cb82a5d423d to your computer and use it in GitHub Desktop.
Batch create colour classes
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
//map global variables with front end class names | |
$globals: ( | |
"text" : $text-color, | |
"bg" : $bg-color, | |
"pg" : $pg-color, | |
"primary" : $primary-color, | |
"secondary" : $secondary-color, | |
"tertiary" : $tertiary-color); | |
// for each vairable | |
@each $name, $color in $globals { | |
// ignore if transparent | |
@if $color != transparent { | |
// set up incriments | |
@each $qty in 05,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90 { | |
// output classes specifying text colour | |
.#{$name}-color-tint-#{$qty} { color: tint ($color, $qty); } | |
.#{$name}-color-shade-#{$qty} { color: shade($color, $qty); } | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment