Skip to content

Instantly share code, notes, and snippets.

@RobertShippey
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertShippey/478c57797cb82a5d423d to your computer and use it in GitHub Desktop.
Save RobertShippey/478c57797cb82a5d423d to your computer and use it in GitHub Desktop.
Batch create colour classes
//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