Add the index iteration variable to @each
See original GitHub issueWhenever i do:
@for $i from 1 through length($colors)
$color: nth($colors, $i)
.column:nth-child(#{$i})
background-color: $color
i feel like a kitten dies somewhere in misery and loneliness. And i find myself doing that in almost any project, so that’s quite a lot of kittens. 😦
I wish i could do this instead:
@each $color, $index in $colors
.column:nth-child(#{$index})
background-color: $color
Please spare the kittens. It’s our war, not theirs.
Issue Analytics
- State:
- Created 10 years ago
- Reactions:6
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Accessing the index in 'for' loops - python - Stack Overflow
The fastest way to access indexes of list within loop in Python 3.7 is to use the enumerate method for small, medium and...
Read more >Looping with indexes - Python Morsels
We start n at 1 and we're incrementing it by 1 in each iteration of our loop. Using range of len (not recommended)....
Read more >Indexing and Iteration - CMU Statistics
There are 3 ways to index a vector, matrix, data frame, or list in R: ... We pass a variable to select on,...
Read more >How to use an index variable with C#'s foreach loop?
A quick way to use an index variable with foreach is to declare one before the loop starts. And then inside the loop...
Read more >Python - Access Index in For Loop With Examples
Using index variable to access the items of the list in order of 0 to 3, where 0 is the default index and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
is this still relevant ?
update: it’s November 2016, whats up? I’m practically sitting and waiting for this 😕
I really would love an index interator variable, too. 😃