Created
April 14, 2022 21:52
-
-
Save ozgurg/289a27125c8df4cd93029cce00fc34b2 to your computer and use it in GitHub Desktop.
SASS make-linear-gradient function
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 make-linear-gradient($degree, $stops) { | |
$gradient: (); | |
@each $percentage, $color in $stops { | |
$gradient: append($gradient, $color $percentage, comma) | |
} | |
@return linear-gradient($degree, $gradient) | |
} | |
.sass { | |
linear-gradient: make-linear-gradient(45deg, ( | |
0%: red, | |
50%: green, | |
100%: blue | |
)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment