From the course: Sass Essential Training

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Color functions

Color functions

- One of the ways that Sass is superior to CSS is the rich color functions that are available to you. To use them, you add the color modules, which, like the math modules, is an extremely large library. I'm just including some of the favorite ways to modify color here. So make sure you check the documentation for the complete list. Now, to start off you add the use at rule for Sass color. Once you have that, then you can add all these different color rules. So you can say color adjust, which is one of the more flexible rules and then also do things like darkened colors or lighten colors, or change their transparency values. Now, here's what something like that would look like. You add the use Sass color, and then I'm creating a color variable right here, and then we can call any one of these other methods. So you can have the color adjust here, takes the original color, and then you can control a number of parameters…

Contents