Last Updated: February 25, 2016
·
2.217K
· nicktomlin

Automatic height and width with compass sprites

A time saving way to get the css dimensions of large collections of sprites.

folder is the name of the folder where your sprites are.

$folder-sprite-dimensions: true; // the magic!
@import "folder/*.png";
@include all-folder-sprites;

Compass will include the height and width of the original file in the sprite selector.

This was hidden away in a discussion thread in the compass-docs