Skip to content

Instantly share code, notes, and snippets.

@mattdrose
Created October 3, 2014 23:47
Show Gist options
  • Save mattdrose/f4893b4da654fe7c2940 to your computer and use it in GitHub Desktop.
Save mattdrose/f4893b4da654fe7c2940 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$color: ();
@mixin addColor($name, $value, $helper: false) {
// Add color to $color map
$color: map-merge($color, ($name: $value)) !global;
// Add helper to CSS
@if $helper == true {
.c--#{$name} {
color: $value;
}
}
}
// Extension
@each $name, $percent in (
lighterestgray: 90,
lightergray: 80,
lightgray: 70,
gray: 50,
darkgray: 30,
darkergray: 20,
darkerestgray: 10,
) {
@include addColor($name, lighten(#000, $percent), true)
}
.c--lighterestgray {
color: #e6e6e6;
}
.c--lightergray {
color: #cccccc;
}
.c--lightgray {
color: #b3b3b3;
}
.c--gray {
color: gray;
}
.c--darkgray {
color: #4d4d4d;
}
.c--darkergray {
color: #333333;
}
.c--darkerestgray {
color: #1a1a1a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment