我想知道是否可以通过在CSS代码中应用类似于lighten或darken的函数来改变Less mixin渐变的颜色?
这是Less Mixin的代码:
.css-gradient(@from: #20416A, @to: #3D69A5) {
background-color: @to;
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to));
background-image: -webkit-linear-gradient(top, @from, @to);
background-image: -moz-linear-gradient(top, @from, @to);
background-image: -o-linear-gradient(top, @from, @to);
background-image: -ms-linear-gradient(top, @from, @to);
background-image: linear-gradient(top, @from, @to);
}
在Less文件中,我想要做这样的事情:
#div {
width:100px;
height:100px;
.css-gradient (darken, 10%);
}
我不知道这是否可能,或者我是否应该以另一种方式完成这个任务。