Modify alpha opacity of LESS variable

后端 未结 2 536
刺人心
刺人心 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条回答
  • 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

    0 讨论(0)
  • 2021-01-30 08:24

    The site documentation gives the answer:

    background: fade(@blue, 20%);
    

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

    0 讨论(0)
提交回复
热议问题