IulianP
IulianP

Reputation: 136

How to generate one sprite from many folders using Compass?

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?

Upvotes: 11

Views: 841

Answers (1)

piouPiouM
piouPiouM

Reputation: 5037

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.

Upvotes: 4

Related Questions