Created
June 12, 2024 14:33
-
-
Save joao-coimbra/2a068adcd379f6c3cadf26fa8558e376 to your computer and use it in GitHub Desktop.
create a smooth gradient with sass function
This file contains hidden or 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 smooth-gradient($direction: 0deg, $color: hsl(0, 0%, 0%)) { | |
| @return linear-gradient( | |
| $direction, | |
| color.change($color, $alpha: 1) 0%, | |
| color.change($color, $alpha: 0.738) 19%, | |
| color.change($color, $alpha: 0.541) 34%, | |
| color.change($color, $alpha: 0.382) 47%, | |
| color.change($color, $alpha: 0.278) 56.5%, | |
| color.change($color, $alpha: 0.194) 65%, | |
| color.change($color, $alpha: 0.126) 73%, | |
| color.change($color, $alpha: 0.075) 80.2%, | |
| color.change($color, $alpha: 0.042) 86.1%, | |
| color.change($color, $alpha: 0.021) 91%, | |
| color.change($color, $alpha: 0.008) 95.2%, | |
| color.change($color, $alpha: 0.002) 98.2%, | |
| transparent 100%, | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment