2createStudio / postcss-sprites

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

Introduce option to encode data URI #16

Closed jednano closed 9 years ago

jednano commented 9 years ago

How do you feel about introducing an embedDataUri option to base64-encode the requested image directly in the CSS? I'm thinking this would be useful with postcss-middleware when you want to serve images directly instead of building a sprite sheet every time a CSS file is requested.

vvasilev- commented 9 years ago

I don't have time at the moment to integrate this feature. If you get something that works, please feel free to open a PR.

jednano commented 9 years ago

I will put something together. I'm still curious how you feel about this feature and if you might have a better idea for the middleware case.

vvasilev- commented 9 years ago

This plugin was created for usage in development stage so I think that the plugin shouldn't be used in middleware at production because will slow down your server response. Also I think that we will have problems with base64 option because the plugin was built around spritesmith module which needs to get all images.

jednano commented 9 years ago

I'm not suggesting it be used for production middleware. We use an Express server for our development server. Anyway, I think I can create a completely separate plugin for this task, come to think of it. Thanks for your feedback.