Skip to content

Instantly share code, notes, and snippets.

@Pickra
Last active May 20, 2017 03:04
Show Gist options
  • Save Pickra/5784a540aea0d6da399beff70b1838e9 to your computer and use it in GitHub Desktop.
Save Pickra/5784a540aea0d6da399beff70b1838e9 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@mixin color-weight ($class, $base-color, $weight: 4) {
$bg-color: null;
@for $i from 1 through 8 {
@if $i < 4 {
$weight: $weight - 1;
$bg-color: lighten($base-color, $weight * 10%);
} @else if $i == 4 {
$weight: 0;
$bg-color: $base-color;
} @else {
$weight: $weight + 1;
$bg-color: darken($base-color, $weight * 10%);
}
.#{$class}-#{$i} { background-color: $bg-color; }
}
}
@include color-weight(bg-blue, #1483ff);
@include color-weight(mad, red);
.bg-blue-1 {
background-color: #add4ff;
}
.bg-blue-2 {
background-color: #7ab9ff;
}
.bg-blue-3 {
background-color: #479eff;
}
.bg-blue-4 {
background-color: #1483ff;
}
.bg-blue-5 {
background-color: #006ae0;
}
.bg-blue-6 {
background-color: #0052ad;
}
.bg-blue-7 {
background-color: #003a7a;
}
.bg-blue-8 {
background-color: #002247;
}
.mad-1 {
background-color: #ff9999;
}
.mad-2 {
background-color: #ff6666;
}
.mad-3 {
background-color: #ff3333;
}
.mad-4 {
background-color: red;
}
.mad-5 {
background-color: #cc0000;
}
.mad-6 {
background-color: #990000;
}
.mad-7 {
background-color: #660000;
}
.mad-8 {
background-color: #330000;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment