Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Sprite map #47

Closed
jnvsor opened this issue Jun 2, 2017 · 36 comments
Closed

SVG Sprite map #47

jnvsor opened this issue Jun 2, 2017 · 36 comments

Comments

@jnvsor
Copy link

jnvsor commented Jun 2, 2017

It would be nice to bundle feather in a single spritemap to reduce number of requests (At least until HTTP/2) You could throw svgo at the spritemap for good measure

@colebemis
Copy link
Member

That's a good idea. I'll look into how I can integrate something like that into the build process.

@roybarber
Copy link

@colebemis I can help integrate a gulp task to generate a spritemap / css and also to optimise the
outputted SVG

@colebemis
Copy link
Member

@roybarber Thanks! I'll reach out to you when I'm ready to start working on that 👍

@Swizz
Copy link

Swizz commented Jun 6, 2017

Can help too. I am still experimenting to find a way to use your icons with the ease of an icon font without the drawbacks.

And svg/use will be the perfect way to do.

@Swizz
Copy link

Swizz commented Jun 7, 2017

svgstore/svgstore seem the best candidate.

Ill work on my own on a proof of concept.

@colebemis
Copy link
Member

@Swizz Thanks! I've also been doing some research on SVG sprites. Pretty cool stuff 👍

@roybarber
Copy link

Would need a gulp/grunt task to automate all the different scenarios and generate CSS

@colebemis
Copy link
Member

Yeah, I'm thinking Gulp, I find it much easier to read than Grunt.

@Swizz
Copy link

Swizz commented Jun 7, 2017

Svgstore is grunt, gulp, cli, I wont choose any task runner for @colebemis. Ill let him choose and work around.

edit : Let's Gulp. Would you like a PR with the reworking of your current workflow into Gulp task ?

@colebemis
Copy link
Member

@Swizz Yeah, I'd love to see what you've come up with. I can't guarantee that I'll merge it into the project right away. I want to spend some time with this and put a lot of thought into it. This article looks pretty promising: https://cloudfour.com/thinks/our-svg-icon-process/

@Swizz
Copy link

Swizz commented Jun 7, 2017

We've done the same readings. Alright, I'll work on it. First by rewriting your current workflow into gulp, and lately the svg sprite construction.

@colebemis
Copy link
Member

How could my current workflow use Gulp? Are you talking about turning the npm scripts into Gulp tasks?

@roybarber
Copy link

roybarber commented Jun 7, 2017

Things like

  • Optimisation
  • PNG generation
  • Sprite generation
  • CSS sprite-map generation
  • Icon font generation
  • Sketch/Illustrator/Photoshop export

etc can be made into a single workflow with seperate commands.

I even use a sketch command on my starting point to export all assets. So depends what you are designing the icons in too. That could be automated!

@colebemis
Copy link
Member

@Swizz Also, is there a reason you're thinking svgStore over gulp-svg-sprite? gulp-svg-sprite seems like it's being actively maintained and svgStore hasn't been updated in a while.

@colebemis
Copy link
Member

@roybarber I'm designing in Illustrator. I tried Sketch but Illustrator handles icons way better. I'm all for automation! I'd love to just export from Illustrator and have the build take care of the rest.

@Swizz
Copy link

Swizz commented Jun 7, 2017

Svgstore were close of that I had in mind. (Task runner independent) as you choose Gulp, we can work with.

I'd like to add to @roybarber list, symlink as icon alias into our workflow.

@colebemis
Copy link
Member

colebemis commented Jun 7, 2017

I'm also interested in how to best deliver and use the SVG sprite with npm as that will probably be how most people will use it. Also, can SVG sprites be used with CDN? I'd love to give people access to Feather in web apps like CodePen or JSBin.

@Swizz
Copy link

Swizz commented Jun 7, 2017

Unpkg works with NPM registry for content delivery, it could be a great candidate for communicate how to use Feather by CDN.

@colebemis
Copy link
Member

colebemis commented Jun 7, 2017

I'm wondering if use will work with a CDN.

For example, will something like this <use xlink:href="https://unpkg.com/../sprite.svg#mail"/> work?

@Swizz
Copy link

Swizz commented Jun 7, 2017

I know use is aware and yelling about cross domain requests, so I won't tell anything without proper testing.

@colebemis
Copy link
Member

👍 Just something to think about

@Swizz
Copy link

Swizz commented Jun 7, 2017

Confirmed, Svg sprite cant be used cross domain.

Entypo takes the choice to insert the SVG in the body. This isnt a good practice, but we can make a specific CDN file with a huge warning.

@colebemis
Copy link
Member

Why not implement something like Entypo?

@Swizz
Copy link

Swizz commented Jun 7, 2017

Im not in love about the concept to inject SVG into the body at runtime. I dont know how this can fit with SPA.

Also, SVG sprite with symbole can be used locally with bundler or not, and providing a SVG sprite can be made Feather useable out of the box for Android native dev and more ! 🎉

But you'r still the boss.

@colebemis
Copy link
Member

Haha just trying to consider all the options. There are a lot of pros and cons to consider for every approach.

@Swizz
Copy link

Swizz commented Jun 7, 2017

We can provide fonts, sprite and loader to fit all needs/wants 👍

@colebemis
Copy link
Member

What do you mean by "loader"?

@Swizz
Copy link

Swizz commented Jun 7, 2017

The "thing like Entypo". I dont figure how to name it yet.

@colebemis
Copy link
Member

Sounds good 👍 I feel like we should try to tackle each of these one by one. Seems like starting with SVG sprite makes the most sense.

@colebemis
Copy link
Member

This looks like a good resource as well: https://abookapart.com/products/practical-svg

@colebemis
Copy link
Member

A LOT of good stuff in here too: https://css-tricks.com/mega-list-svg-information/

@mshwery
Copy link

mshwery commented Jun 7, 2017

Hm... Maybe have to provide a React wrapper or port these to react-icon

@colebemis
Copy link
Member

@mshwery We're discussing that over on #41.

@Swizz
Copy link

Swizz commented Jun 8, 2017

So much reading.

But I can tell you, that SVG Font is not an option anymore.

Also take a look at http://evil-icons.io/

@colebemis
Copy link
Member

Let's move this conversation to #101 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants