Created
November 1, 2016 11:14
-
-
Save mreis1/fbcc2abc5083e1500a805296797faedf to your computer and use it in GitHub Desktop.
sass-utilities
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
//converts a $color into a contrast color | |
@function mr-smart-contrast($color) { | |
@if (lightness($color) > 50) { | |
@return rgba(0,0,0,0.9); // Lighter backgorund, return dark color | |
} @else { | |
@return rgba(255,255,255,0.9); // Darker background, return light color | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment