Skip to content

Instantly share code, notes, and snippets.

@jackilyn
Created July 2, 2012 19:21
Show Gist options
  • Select an option

  • Save jackilyn/3035100 to your computer and use it in GitHub Desktop.

Select an option

Save jackilyn/3035100 to your computer and use it in GitHub Desktop.
Compass mixin for text color and proper 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);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment