1

I have a bunch of images that have different dimensions. Compass is great with compiling all the files into a single sprite, generating classes from their filenames and applying the background-position to them.

Is it possible to have Compass also apply width and height properties to those generated classes?

$iconsWithDifferentDimensions-layout: smart;
@import "iconsWithDifferentDimensions/*.png";
@include all-iconsWithDifferentDimensions-sprites;
cimmanon
  • 67,211
  • 17
  • 165
  • 171

1 Answers1

4

Yes. Set this magic variable before your @import line:

$iconsWithDifferentDimensions-sprite-dimensions: true;

And Compass will include the width and height of each icon in the sprite.

Jackie
  • 1,630
  • 2
  • 15
  • 12