Answer the question
In order to leave comments, you need to log in
How to use variables in SASS?
There is such a code
.image
position: relative
@for $i from 0 to 7
&:nth-child(#{$i + 1})
&:before
content: ''
@include sprite($advantages-$i)
@include sprite($advantages-1)
- will return the styles for the image from the sprite. @include sprite($advantages-1)
, @include sprite($advantages-2)
etc.?
Answer the question
In order to leave comments, you need to log in
You have a cycle from 0, so you need to @include sprite($advantages - $i + 1)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question