Last active
November 27, 2017 20:29
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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