Less中的Parseerror:无法识别的输入

时间:2017-12-11 12:37:53

标签: css less

我在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;
 }
}

我可以少用sincos吗?或者我的代码有问题吗?

0 个答案:

没有答案
相关问题