Lighten & Darken with LESS
May 25 · 2015
I had a LESS file full of color variables and it looked something like this:
My need for additional color tints grew and so did the length of the variable names. Say hi to
@color-blue-very-very-light! There was a another problem: if I wanted to change the hue of
@color-blue I would have to change each and every tint.
An unsustainable situation. Today I found out that LESS (and Sass for that matter) has a
lighten and a
darken function. That means that I can have a master color (e.g.
@color-blue) and use
darken to create the tints: