3 ms·
Show HN: SVGInject – Make external SVG files fully CSS styleable with injection
- swimmadude66 8y agoDo you have any plans to add a webpack plugin to inject SVGs at build time? If not, do you mind if I try to create one using the API provided?
- jansan 8y agoThere was a request to implement this functionality for ParcelJS, but decided against it. Here is the issue: https://github.com/iconfu/svg-inject/issues/19 https://github.com/iconfu/svg-inject/issues/19 Basically we want to keep the project small and focused on the injection itself. Also there is a potential issue with multiple IDs if you pre-inline SVGs (we call this ID hell). If you want to give it a shot, please go ahead. You can contact us anytime through the issues in the SVGInject project for support or API change requests (I am waruyama on GitHub).
- spdustin 8y agoThis is great, and something I can use in client projects. I'll also include this as a recommendation in my SharePoint classes that use SVGs for data visualization. Excellent script! (I never did understand why CSS can't style referenced SVGs, personally)