yostudios / Spritemapper

CSS Spritemap Generator
http://yostudios.github.com/Spritemapper/
MIT License
595 stars 42 forks source link

Optimize your CSS #14

Closed jwerre closed 13 years ago

jwerre commented 13 years ago

I haven't tried it yet but I was looking at your CSS on your homepage and you could optimize it a bit. Instead of declaring the background image multiple times just do it once in the "letter" class like so:

.letter {
  background: url(../img/awesome-font.png);
}
.letter.a {
  width: 22px; height: 17px;
  background-position: -x -y;
}
.letter.b {
   width: 15px; height: 17px;
   background-position: -x -y;
}
.letter.c {
   width: 16px; height: 17px;
   background-position: -x -y;
}

Great tool by the way!

jnordberg commented 13 years ago

I'ts very hard to do this without special syntax, and we want do avoid this. Closing for now