Skip to content

Instantly share code, notes, and snippets.

@MadeByMike
MadeByMike / css-less-text-contrast
Created February 14, 2014 04:15
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;
}