Modify alpha opacity of LESS variable

ben picture ben · Oct 7, 2012 · Viewed 75.2k times · Source

Using LESS, I know that I can change the saturation or tint of a color variable. That looks like this:

background: lighten(@blue, 20%);

I want to change the alpha opacity of my color, though. Preferably like this:

background: alpha(@blue, 20%);

Is there a simple way to do this in LESS?

Answer

ScottS picture ScottS · Oct 7, 2012

The site documentation gives the answer:

background: fade(@blue, 20%);

The function name is fade not alpha according to that document.