Answer the question
In order to leave comments, you need to log in
Mixin for sprite, scss?
Good afternoon! Please tell me how to correctly extract images from a sprite with sass. Pictures in a sprite of different sizes, using scss. It would be ideal to create a mixin with a loop that would immediately insert the background-position, to a class such as .item--(). I understand how it should be, but something got confused in these mixins.
I would be very grateful for your help!
Answer the question
In order to leave comments, you need to log in
You cannot do this with SASS, because in essence, a sprite is a big picture and you need to show part of it and use background-position to move the sprite itself.
In total, SASS needs to know the size of the displayed part of the picture and the position of the displayed picture. He doesn't know how out of the box.
You can try Compass , or something more modern spriteSmith
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question