Last active
April 1, 2020 18:08
-
-
Save darrensq/0015f5bfb83a7b9e13abcac9f9c96074 to your computer and use it in GitHub Desktop.
Sass Adaptive Color Helper #css #sass
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
@function adaptive-color($color, $percentage) { | |
@if (lightness($color) > 40) { | |
@return darken($color, $percentage); | |
} @else { | |
@return lighten($color, $percentage); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment