June 2025
Beginner
817 pages
31h 30m
English
Colors can be specified in Sass as usual in CSS with rgb(), rgba(), hsl(), hsla(), #fff, #ffffff, and of course the CSS keywords for color such as green, gray, red, and so on. In addition, Sass contains functions to adjust the brightness and saturation of colors. I’ve listed some of these functions for you in Table 16.12.
|
Syntax |
Example |
Description |
|---|---|---|
|
lighten(color, [n]%) |
background:lighten($color, 10%); |
Lightens the color by n% |
|
darken(color, [n]%) |
background:darken($color, 10%); |
Darkens the color by n% |
|
desaturate(color, [n]%) |
background:desaturate($color, 30%); |
Reduces the color saturation by n% |
|
saturate(color, [n]%) |
background:saturate($color, 30%); |
Increases the ... |
Read now
Unlock full access