Trying to do math inside my loop.
@for $i from 1 through length($colors) {
ul li:nth-child(#{$i}) {
z-index: length($colors) - #{$i};
}
}
But what I get in CSS, for example, is:
li:nth-child(2) {
z-index: 8-2;
}
How can I force SASS to do math and get:
li:nth-child(2) {
z-index: 6;
}
Thanks for help!