我在Less中有一个代码,我无法运行它。显示无法识别的输入错误。
我认为这是问题
@divnum: 20;
.rainbow(@counter) when (@counter > 0) {
.rainbow((@counter - 1));
// Mixin is called within itself, creating the loop, but will only work while @counter > 0
@clr: @counter * 360/@divnum;
@top: cos((@counter * 360/@divnum)deg) * 400px;
@left: sin((@counter * 360/@divnum)deg) * 400px;
div:nth-child(@{counter}){
// nth-child is called based on the counter value
background-color: hsl(@clr, 100%, 50%);
position:relative;
top: @top;
left: @left;
}
}
我可以少用sin
和cos
吗?或者我的代码有问题吗?