2createStudio / postcss-sprites

Generate sprites from stylesheets.
MIT License
413 stars 50 forks source link

Apply background-size for all sprites? #76

Closed evandavis closed 7 years ago

evandavis commented 7 years ago

I noticed that background-size is only applied for retina sprites (see https://github.com/2createStudio/postcss-sprites/blob/master/src/core.js#L452).

Is there any reason not to always apply it?

vvasilev- commented 7 years ago

The reason was that only the retina sprites need to have a background-size. I agree with you so it will be fixed in few moments.

yutucc commented 7 years ago

sorry,I don't get it.

why all sprites need apply background-size ?

like this:

.test-sprite {
  background-image: url(../../build/images/sprite.png);
  background-position: -60px 0px;
  background-size: 89px 86px;
  width: 29px;
  height: 28px; }

.test-sprite3 {
  background-image: url(../../build/images/sprite.png);
  background-position: -60px -28px;
  background-size: 89px 86px;
  width: 20px;
  height: 27px; }

.test-sprite4 {
  background-image: url(../../build/images/sprite.png);
  background-position: 0px -60px;
  background-size: 89px 86px;
  width: 19px;
  height: 26px; }