You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been pretty swamped with school and work. Do you want to open a PR?
We currently have a node script called bin/build-svgs.js that processes all the SVGs from the icons direction and puts them in the dist/icons directory. To create an SVG sprite, all we should have to do is write a similar bin/build-sprite.js script that processes all the SVGs from the icons directory and combines them into a dist/feather-sprite.svg. You'd also have to do some research on current best practices for SVG sprites (because they change so frequently).
I may start working on this soon, I'm really needing it in sprite form, because I can't stand react-feather's one component per icon approach. I've already made an Icon helper component for using with Open Iconic's sprite so I think I'll follow Open Iconic's approach for the sprite.
I made a script that builds the sprite using dist/icons.json, so it must be run after the current main build. The SVG attributes of the inner linked file in the <use /> tag don't work, so the SVG attributes, class or style must be passed when using the inline SVG tag. Just like this:
As today is Saturday and I've had enough already, I'll write the tests on Monday and make a PR as soon as possible. The script and SVG file follows: build-sprite.zip
Activity
colebemis commentedon Oct 13, 2017
I've been pretty swamped with school and work. Do you want to open a PR?
We currently have a node script called
bin/build-svgs.jsthat processes all the SVGs from theiconsdirection and puts them in thedist/iconsdirectory. To create an SVG sprite, all we should have to do is write a similarbin/build-sprite.jsscript that processes all the SVGs from theiconsdirectory and combines them into adist/feather-sprite.svg. You'd also have to do some research on current best practices for SVG sprites (because they change so frequently).wuweiweiwu commentedon Jan 16, 2018
@colebemis is this still under works? I'd take it :)
colebemis commentedon Jan 16, 2018
@wuweiweiwu I don't think anyone is working on this right now. Feel free to take it on 👍
ivanquirino commentedon Feb 17, 2018
I may start working on this soon, I'm really needing it in sprite form, because I can't stand react-feather's one component per icon approach. I've already made an Icon helper component for using with Open Iconic's sprite so I think I'll follow Open Iconic's approach for the sprite.
ivanquirino commentedon Feb 17, 2018
I made a script that builds the sprite using
dist/icons.json, so it must be run after the current main build. The SVG attributes of the inner linked file in the<use />tag don't work, so the SVG attributes, class or style must be passed when using the inline SVG tag. Just like this:The following CSS class was extracted from the default icon attributes and renders it nicely:
As today is Saturday and I've had enough already, I'll write the tests on Monday and make a PR as soon as possible. The script and SVG file follows:
build-sprite.zip
ivanquirino commentedon Feb 19, 2018
That's it: #319
colebemis commentedon May 21, 2018
Closed in #319