2createStudio / postcss-sprites

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

SVG sprites support #61

Closed niksy closed 8 years ago

niksy commented 8 years ago

I’ve started with SVG support so that this plugin can handle background-position based SVG images instead of only rasters.

This is a very crude implementation, but I’m submitting a PR to see if you’re willing to merge changes and implement additional feature to this plugin. SVG icons and images are used more and more and it would be great to have seamless support with this plugin rather with some additional plugin.

vvasilev- commented 8 years ago

@niksy, Big thanks for starting this feature. Today I'm too busy but next week I will merge your PR to polish the implementation and fix the failing tests. :smile:

I’ve encountered the problem on line https://github.com/2createStudio/postcss-sprites/compare/master...niksy:svg-sprite-support?expand=1#diff-c4452a5b3534ba594edf670191abc3f7R14 where getting external file (JSON template) is inproperly resolved since it’s not copied from src to lib, do you have an idea how to solve this?

Probably you can fix this by adding something like && cp ./src/svg-sprite/json.html ./lib/svg-sprite/json.html to the build script in package.json

niksy commented 8 years ago

@vvasilev- Issue https://github.com/jkphl/svg-sprite/issues/176 is now resolved and we can continue with SVG support! :) I’ve modified the code to follow rules described in the issue and basic tests are now passing.

Are you planning on working on this in near future?

niksy commented 8 years ago

@vvasilev- have you had any chance to look at this?