Created
October 9, 2013 03:02
-
-
Save darren131/6895553 to your computer and use it in GitHub Desktop.
Change the text colour of an element based on the darkness of the background colour
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 set-color($background-color: #c00) { | |
@if lightness($background-color) > lightness(#aaaaaa) { | |
color: $dark; | |
} @else { | |
color: $light; | |
} | |
background:$background-color; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment