I was wondering if you can get an element index for the @each loop.
I have the following code, but I was wondering if the $i variable was the best way t
$i
To update this answer: yes you can achieve this with the @each loop:
@each
$colors-list: #111 #222 #333 #444 #555; @each $current-color in $colors-list { $i: index($colors-list, $current-color); .stuff-#{$i} { color: $current-color; } }
Source: http://12devs.co.uk/articles/handy-advanced-sass/