Skip to content

Instantly share code, notes, and snippets.

@chriseppstein
Created March 25, 2012 02:53
Show Gist options
  • Save chriseppstein/2190930 to your computer and use it in GitHub Desktop.
Save chriseppstein/2190930 to your computer and use it in GitHub Desktop.
How I'd implement https://gist.github.com/2190496 in Sass
@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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment