Skip to content

Instantly share code, notes, and snippets.

@morningtoast
Created March 10, 2017 20:00
Show Gist options
  • Save morningtoast/b09346b98c5de905d5b4c01352672b31 to your computer and use it in GitHub Desktop.
Save morningtoast/b09346b98c5de905d5b4c01352672b31 to your computer and use it in GitHub Desktop.
Contrast color function for Foundation 6
@function get-contrast-color($bgcolor) {
$darker-ratio: color-contrast($bgcolor, #000);
$lighter-ratio: color-contrast($bgcolor, #fff);
@if($darker-ratio > $lighter-ratio){
@return #000;
}
@if($lighter-ratio > $darker-ratio){
@return #fff;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment