How do I convert a hexadecimal color to rgba with the Less compiler?

前端 未结 4 550
温柔的废话
温柔的废话 2020-12-07 13:16

I have the following code:

@color : #d14836;

.stripes span {
    -webkit-background-size: 30px 30px;
    -moz-background-size: 30px 30px;
    background-siz         


        
4条回答
  •  -上瘾入骨i
    2020-12-07 14:13

    It seems that with the recent Less update 3.81, you can use just two arguments in the rgba() function.

    rgba(white, 0.3) or rgba(white, 30%) => rgba(255, 255, 255, 0.3)
    

    It works for me, but I can't find it in the official documentation.

提交回复
热议问题