我有以下密码:
@color : #d14836;
.stripes span {
-webkit-background-size: 30px 30px;
-moz-background-size: 30px 30px;
background-size: 30px 30px;
background-image: -webkit-gradient(linear, left top, right bottom,
color-stop(.25, rgba(209, 72, 54, 1)), color-stop(.25, transparent),
color-stop(.5, transparent), color-stop(.5, rgba(209, 72, 54, 1)),
color-stop(.75, rgba(209, 72, 54, 1)), color-stop(.75, transparent),
to(transparent));
我需要把 @color
转换成 rgba(209, 72, 54, 1)
。
因此,我需要在代码中用一个从 @color
变量生成 rgba()
值的 Less 函数替换 rgba(209, 72, 54, 1)
。
我怎么能用“更少”做到这一点呢?