-
-
Save nickcooley/2290899 to your computer and use it in GitHub Desktop.
How I'd implement https://gist.github.com/2190496 in Sass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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