Following the Spriting with Compass page instruction about the magical dimension functions, I'm trying to set the sizes of each sprite, using something like that:
.top-bar-section {
ul {
& > li {
// Generate the sprite map.
$menu_icons-sprite-map: sprite-map("menu_icons/*.png", $layout: smart);
// Set the background image.
& > a:before {
background: sprite-url($menu_icons-sprite-map) 0 0 no-repeat;
display: inline-block;
content: "";
@include background-size(cover);
}
// Set the background position for each sprite.
$menu_icons-sprite-names: sprite-names($menu_icons-sprite-map);
@each $name in $menu_icons-sprite-names {
&.menu_icons-#{$name} > a:before {
background-position: sprite-position($menu_icons-sprite-map, $name);
$height: menu_icons-sprite-height($name);
$width: menu_icons-sprite-width($name);
height: $height;
width: $width;
}
}
}
}
However, the produced CSS looks like that:
...
.top-bar .top-bar-section ul > li.menu_icons-omino_001 > a:before {
background-position: 0 0;
height: menu_icons-sprite-height(omino_001);
width: menu_icons-sprite-width(omino_001);
}
.top-bar .top-bar-section ul > li.menu_icons-omino_002 > a:before {
background-position: 0 -64px;
height: menu_icons-sprite-height(omino_002);
width: menu_icons-sprite-width(omino_002);
}
...
It seems like the magical function is not created by Compass: am I missing something?