2createStudio / postcss-sprites

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

Background-repeat is deleted when generating with postcss #77

Closed ccasalengua closed 7 years ago

ccasalengua commented 7 years ago

I have a simple problem:

When the final file is generated, the background-repeat is deleted. I try to apply it below but it does not work ...

This is my code:

Input: .postcss-img { background: url(../assets/img/sprite/ico-accordion.png) no-repeat 0 0 transparent; background-repeat: no-repeat; } .postcss-img2 { background: url(../assets/img/sprite/ico-accordion-open.png) no-repeat 0 0 transparent; background-repeat: no-repeat; }

Output: .postcss-img { background-image: url(../assets/img/sprite/sprite.png); background-position: 0px 0px; background-size: 42px 21px; } .postcss-img2 { background-image: url(../assets/img/sprite/sprite.png); background-position: -21px 0px; background-size: 42px 21px; }

Can you help me? Thanks

vvasilev- commented 7 years ago

Hey @ccasalengua,

You don't need a background-repeat property because every element that uses the sprite should have width & height properties. 😄

ccasalengua commented 7 years ago

This is a possible solution but I need the background-repeat: no-repeat for another type.

Thanks for your help!