Last active
August 29, 2015 14:15
-
-
Save ColeTownsend/951bc7b0a686ef84e200 to your computer and use it in GitHub Desktop.
This file contains 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
@mixin bg-color($color, $darken) { | |
// local variables | |
$background-color: darken($color, $darken); | |
$lightness: lightness($background-color); | |
// calculate text color variable | |
@if $lightness < 50 { | |
$text-color: lighten($background-color, 15); | |
$background-color: desaturate($background-color, 7); | |
background: $background-color; | |
color: $text-color; | |
} | |
@else { | |
$text-color: darken($background-color, 15); | |
$background-color: desaturate($background-color, 6); | |
background: $background-color; | |
color: $text-color; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment