Open zeke opened 10 years ago
Hey Zeke,
Unfortunately I've only used this in closed-source projects so don't have a good example right now! svgify
extracts the contents of an SVG file, and exposes a function you can call that returns the contents wrapped up in a group element.
The API actually needs a bit of a rework, I think, and I might go and clean that up in the next couple of days or so. Though if you wanted to use it now:
var createGroupElement = require('./icon.svg')
var node = createGroupElement()
Will create something along these lines:
<g>
<g>
...
<icon-contents>
...
</g>
</g>
Which you can then append to an SVG element (it won't work just being appended directly to the DOM). Does that make more sense? :)
That helps! Thanks for taking the time to reply. Looking forward to playing with this, and will keep my eyes out for your updates.
Howdy Hugh,
Do you have examples of this module in use in another project? I think this module is what I'm looking for, but I'm a bit perplexed by the usage example in the README.
Once I've got a better handle on it, I'd be happy to help update the docs. :)