2 回答

TA贡献1859条经验 获得超6个赞
// loop start
.taskSlideBg(@num) when (@num <6){
@num2:~"@{num}n";
@color:"mkcolor@{num}";
#mkUser-task-con .mkUser-task-box:nth-child(@{num2}) .mkUser-task-title{background:@@color;}
.taskSlideBg((@num+1))
}
.taskSlideBg(1);
// loop end
编译之后
#mkUser-task-con .mkUser-task-box:nth-child(1n) .mkUser-task-title {
background: #6ec5ff;
}
#mkUser-task-con .mkUser-task-box:nth-child(2n) .mkUser-task-title {
background: #ff8365;
}
#mkUser-task-con .mkUser-task-box:nth-child(3n) .mkUser-task-title {
background: #fdc139;
}
#mkUser-task-con .mkUser-task-box:nth-child(4n) .mkUser-task-title {
background: #83d36d;
}
#mkUser-task-con .mkUser-task-box:nth-child(5n) .mkUser-task-title {
background: #03afaf;
}

TA贡献1869条经验 获得超4个赞
.loop(@count) when (@count > 0) {
.loop(@count - 1);
.testItem-@{count} {
animation-name: ~"kf-@{count}";
}
}
.loop(3);
- 2 回答
- 0 关注
- 1085 浏览
添加回答
举报