How to generate one sprite from many folders using Compass?

compass-sass, css, sass

Solution

Up to Compass 0.12.1 you can use this:

@import "mobile/**/*.png";

Regression may be appeared with version 0.12.2, preventing this syntax to work. Instead, you can browse a list of directories:

@import "mobile/{,icons}/*.png";

Be sure to start the list with a comma in order to target the current directory `mobile`.

Problem

I have one folder containing images which also has a subfolder with images. I need to generate just one sprite, not two as happens now, and I also want to control the generated classes depending on the folder/subfolder: ``` @import "mobile/*.png"; @import "mobile/icons/*.png"; ``` How can I make compass generate just one sprite?

Original source