Last Updated: February 25, 2016
·
601
· jackilyn

Compass Mixin for Proper Text Contrast

@mixin fg-color($bg-color) {
    @if lightness($bg-color) < 30% {
        color: #eee;
    } else {
        color: #333;
    }
}

@mixin readable($bg-color) {
    background-color: $bg-color;
    @include fg-color($bg-color);
}