One possible approach:
for $i in (1..81)
.block:nth-child({$i})
transition transform 500ms ease 1s * $i
That's actually quite similar to the example given in Selector Interpolation section of Stylus documentation.
题
Following code
for $i in (1..81)
.block:nth-child({$i})
transition transform 500ms ease $i\s
will be compiled to
.block:nth-child(1) {
transition: transform 500ms ease 1 s;
}
......
But that space between number and seconds is redundant!
How can I remove it?
解决方案
One possible approach:
for $i in (1..81)
.block:nth-child({$i})
transition transform 500ms ease 1s * $i
That's actually quite similar to the example given in Selector Interpolation section of Stylus documentation.
其他提示
You can use the unit()
function:
for $i in (1..81)
.block:nth-child({$i})
transition transform 500ms ease unit($i, 's')