문제

Is it possible to implement something like this in Stylus?

for $i in 1..5 and $n in a b c d e
  .icon-{$i}:before{
    content: $n 
  }
도움이 되었습니까?

해결책

To answer your question: yes.


and here is how: http://codepen.io/anon/pen/jIbdq

icon_contents = ( "a" "b" "c" "d" "e" )

for v, k in icon_contents
  .icon-{k+1}:before
    content v
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top