Modify alpha opacity of LESS variable

后端 未结 2 630
刺人心
刺人心 2021-01-30 07:30

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

2条回答
  •  Happy的楠姐
    2021-01-30 08:10

    For completeness

    fade

    Set the absolute transparency of a color. Can be applied to colors whether they already have an opacity value or not.

    background: fade(@blue, 20%);
    

    fadein

    Decrease the transparency (or increase the opacity) of a color, making it more opaque.

    background: fadein(@blue, 80%);
    

    fadeout

    Increase the transparency (or decrease the opacity) of a color, making it less opaque. To fade in the other direction use fadein.

    background: fadeout(@blue, 20%);
    

    View Complete Documentation

提交回复
热议问题