0

how to generate sprite with fewest empty space using compass sass?
I can not find any setting option to get smart layout for sprit-map function.
but I find that

$dropcap-layout:smart
@import "dropcap/*.png";
can do the job.

but not for sprite-map function.anyone help?

$map: sprite-map("sprite_common/*.png");
%sprite_common{
    background-image: sprite-url($map);
    background-repeat: no-repeat;
}

@mixin common_output($sprite){
    @extend %sprite_common;
    width: image-width(sprite-file($map, $sprite));
    height: image-height(sprite-file($map, $sprite));
    background-position: sprite-position($map,$sprite);
}

.top_tabs .arrow{
    @include common_output(checkout_setting__crumb_arrow);
} 

.uc_pagination .previous .arrow{
    @include common_output(account__center_prev_page);
}
......

enter image description here

By the way, how to genterate sprite png with no radom charater?
for example ,i want sprite_common.png but not sprite_common-s2788fbf16e.png

linjuming
  • 2,117
  • 4
  • 23
  • 32
  • 1
    I understand what you're trying to achieve, but I don't know why. With PNGs, empty space has almost no effect on the file size. – user123444555621 Dec 15 '12 at 08:48
  • and how to remove random charaters ? – linjuming Dec 15 '12 at 08:58
  • 2
    This doesn't answer your question, but I'd rather not remove the random characters, since they make sure the browser shows the latest version of the image. This is called ["filename based revving"](http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/). – user123444555621 Dec 15 '12 at 09:31
  • What @Pumbaa80 said. You want those random characters for cache busting. And I don't believe you can do smart layout with `sprite-map`, but maybe someone else will suggest otherwise. – glortho Dec 15 '12 at 14:25
  • please tell me how to delete ramdom charaters, I need it for 2 pngs ,one is for ie6 using png8 – linjuming Dec 17 '12 at 01:22

0 Answers0