less css calling dynamic variables from a loop
问题 What I'm trying to do: I have (for now) 7 colors as variables. I want to be able to use them at several places and iterate throught them. This is what I have that don't work @color1:#06A1C0; @color2:#8F4F9F; @color3:#ED1D24; @color4:#5A9283; @color5:#B38C51; @color6:#EC008C; @color7:#8F4F9F; @iterations: 8; .mixin-loop (@index) when (@index > 0) { color@{index}:hover{ @tmp: ~'@color'; @num: @index; color: @tmp@num; } .mixin-loop(@index - 1); } .mixin-loop (0) {} .mixin-loop(@iterations); What