문제

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')
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top