less 循环
.loop(@n, @i: 1) when (@i =< @n) { {i} { background: mix(@primary, #fff, 10%*@i); } {i} { background: mix(@secondary, #fff, 10%*@i); } .loop(@n, (@i + 1)); } .loop(10);
.generate-z-index(@n, @i: 1) when (@i =< @n) { .item:nth-child(@{i}) { z-index: (); } .generate-z-index(@n, (@i + 1)); } .generate-z-index(100);
.backgroundcard(@className, @pngName) { {className} { background: url("./resource/@{pngName}.png") top/100% no-repeat; } } @bgcardList:a,b,c,d,e,f,g; .loop(@i) when (@i < length(@bgcardList)+1){ .backgroundcard(extract(@bgcardList, @i),extract(@bgcardList, @i)); .loop(@i+1); } .loop(1);
相关推荐
nicepainkiller 2020-05-05
Ladyseven 2020-10-22
luofuIT成长记录 2020-09-22
Mynamezhuang 2020-09-18
李鴻耀 2020-08-17
yaodilu 2020-08-03
zhoujiyu 2020-06-28
89510194 2020-06-27
CaiKanXP 2020-06-13
MaureenChen 2020-06-12
Phoebe的学习天地 2020-06-07
淡风wisdon大大 2020-06-06
buttonChan 2020-06-06
xtuhcy 2020-05-20
AlisaClass 2020-05-18
赵家小少爷 2020-05-16