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);
Written by Walid
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#