Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@philzelnar
Last active November 27, 2017 20:29
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 philzelnar/ba1762cb1e705facef01d509b713f943 to your computer and use it in GitHub Desktop.
Save philzelnar/ba1762cb1e705facef01d509b713f943 to your computer and use it in GitHub Desktop.
Sass functions used to tint (add white to) and shade (add black to) a color.
// Tint/Shade for Sass
//
// .example {
// background-color: tint($color-var, 35%);
// color: shade(#00cdff, 20%);
// }
@function tint($color, $percentage) {
@return mix(white, $color, $percentage);
}
@function shade($color, $percentage) {
@return mix(black, $color, $percentage);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment