Skip to content

Instantly share code, notes, and snippets.

@dlbnco
Created January 6, 2018 13:44
Show Gist options
  • Save dlbnco/d69705de507d35358aa9fb7e8ea6e6b5 to your computer and use it in GitHub Desktop.
Save dlbnco/d69705de507d35358aa9fb7e8ea6e6b5 to your computer and use it in GitHub Desktop.
Create text and background color classes with SASS variables
$colors: (
red: #ed3237,
blue: #3e4095,
white: #fff,
);
@each $value in $colors {
.text-#{nth($value, 1)} {
color: nth($value, 2);
}
.bg-#{nth($value, 1)} {
background-color: nth($value, 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment