Created
July 2, 2012 19:21
-
-
Save jackilyn/3035100 to your computer and use it in GitHub Desktop.
Compass mixin for text color and proper contrast
This file contains hidden or 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
| @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); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment