scale-color($color, $kwargs)

Scales one or more properties of a color by a percentage value. Unlike adjust-color($color, $kwargs), which changes a color’s properties by fixed amounts, scale_color fluidly changes them based on how high or low they already are. So if we use scale color twice: scale-color scale-color, it won’t change the lightness much, but lightening a dark color by the same amount will change it more dramatically. This has the benefit of making ‘scale-color($color, ...)‘ have a comparable effect across color palettes.

For example, the lightness of a color can be anywhere between 0 and 100. If ‘scale-color($color, $lightness: 40%)‘ is called, the resulting color’s lightness will be 40% of the way between its original lightness ...

Get Pragmatic Guide to Sass now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.