2
我有這樣的mixin:少混入循環類,但有不同的價值觀
.myClass {
.nth(1);
.nth(2);
.nth(@i) {
&:nth-of-type(@{i}) {
transition-delay: 0.2s;
}
}
}
是在一些編制,如:
.myClass:nth-of-type(1) {
transition-delay: 0.2s;
}
.myClass:nth-of-type(2) {
transition-delay: 0.2s;
}
我的問題是如何爲transition-delay
因爲在此添加不同的價值觀表單將重複相同的值,我需要能夠添加不同的值,並編譯類似於:
.myClass:nth-of-type(1) {
transition-delay: 0.5s;
}
.myClass:nth-of-type(2) {
transition-delay: 0.02s;
}
等等......
你必須修改你的mixin以延遲作爲參數(或)有s數學計算的延遲(如第一元素1秒,2秒等第二等將意味着@i * 1s)。 – Harry
@哈利是啊,但我真的不知道該怎麼做:))也許使用索引和劃分.. – BurebistaRuler
哪一個?前者還是後者? 「transition-delay」的值是否有一個模式? – Harry