Skip to content

Instantly share code, notes, and snippets.

@mreis1
Created November 1, 2016 11:14
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 mreis1/fbcc2abc5083e1500a805296797faedf to your computer and use it in GitHub Desktop.
Save mreis1/fbcc2abc5083e1500a805296797faedf to your computer and use it in GitHub Desktop.
sass-utilities
//converts a $color into a contrast color
@function mr-smart-contrast($color) {
@if (lightness($color) > 50) {
@return rgba(0,0,0,0.9); // Lighter backgorund, return dark color
} @else {
@return rgba(255,255,255,0.9); // Darker background, return light color
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment