O'Reilly logo

Pragmatic Guide to Sass by Michael Lintorn Catlin, Hampton Catlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required