Created
February 14, 2014 04:15
-
-
Save MadeByMike/8995684 to your computer and use it in GitHub Desktop.
less mixin for contrasting text background colours
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
.text-contrast(@background) when (abs(lightness(@background)) > 50) { | |
color: #000; | |
} | |
.text-contrast(@background) when (abs(lightness(@background)) < 51) { | |
color: #FFF; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment