Last Updated: February 25, 2016
· walidvb

Using an image folder to generate sprites with Compass

As explained at length in this post, it's fairly easy to create a sprite on the fly and never have to think about background-positions anymore. Simple as:

@import "compass/utilities/sprites";
@import "foo/*.png";
@include  all-foo-sprites;  

And to call the background image:

@include foo-sprite(bar-image);