Created
October 15, 2013 15:00
-
-
Save austinpray/6992952 to your computer and use it in GitHub Desktop.
Dynamically change text color based on its background with Sass via http://codepen.io/sebastianekstrom/pen/uHAtL
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
@function set-text-color($color) { | |
@if (lightness( $color ) > 40) { | |
@return black; | |
} | |
@else { | |
@return white; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment