Skip to content

Instantly share code, notes, and snippets.

@MadeByMike
Created February 14, 2014 04:15
Show Gist options
  • Save MadeByMike/8995684 to your computer and use it in GitHub Desktop.
Save MadeByMike/8995684 to your computer and use it in GitHub Desktop.
less mixin for contrasting text background colours
.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