Skip to content

Instantly share code, notes, and snippets.

@barning barning/color-tiles.scss
Last active Nov 7, 2018

Embed
What would you like to do?
Color Tile Generator
$colors: (
primary: #de1c24,
secondary: #d3ffce,
):
// Generates Colors Tiles automatically. No need to write more SCSS
@each $name, $color in $colors {
&--#{$name} {
.color-tile__color {
background-color: $color;
@if (lightness($color) > 80) {
color: black;
}
@else {
color: white;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.