public
Last active

How I'd implement https://gist.github.com/2190496 in Sass

  • Download Gist
color_shifted.scss
SCSS
1 2 3 4 5 6 7 8 9 10 11 12 13
@function color-shift($color, $amount: 10%) {
@return if(lightness($color) > 50%,
darken($color, $amount),
lighten($color, $amount))
}
 
$my-bg-color: #333;
$my-fg-color: #c00;
 
.shifted {
background-color: color-shift($my-bg-color);
color: color-shift($my-fg-color);
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.