Skip to content

Instantly share code, notes, and snippets.

@darren131
Created October 9, 2013 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darren131/6895553 to your computer and use it in GitHub Desktop.
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
@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