SVG in place if icon font #60
Comments
+1. @davidakennedy and I have been chatting about this as well and we think it's the right theme to ditch icon fonts. :) |
I have been using SVG icons in my latest public themes. I'd love to contribute on this one if you want. My starting point have been how It covers at least these areas:
Just let me know if there is something where we can start. |
Very nice @samikeijonen! I have not tested this, so I'll just ask the question: Does this inject the SVG as an inline element, or reference it? |
I'm not sure about correct English terms but there are two ways I have injected SVGs.
In this method we include SVG sprite in the wp_footer. This is the method I'm using in Checathlon theme. Note that in the Customizer I use external reference, otherwise SVG icons won't show up in the preview. There is a core ticket for this.
This is the method I use in Some theme at the moment. |
Either one of these approaches will work, provided there are proper fallbacks through some form of JS inclusion. The main point is to ensure the SVGs are true elements in the markup, not merely background images. There are many paths that lead to that result. Yours looks like a pretty solid start. |
Do you want me to create PR for Social menu using SVGs so we could start somewhere. This is also related to #65. |
I'm inclined to say yes, but I think we should hold off until Mel gives the all-clear. |
Let's hold off on this pending #65, since I'm not sure yet which icons we're going to be using. |
Hi @melchoyce. Just to make sure, I have couple of questions:
|
I created PR #206 where I only touched social links menu. Let me know where you want to continue discussion. Fallback for IE8 I was thinking using feature.js or similar lightweight library. We could detect if browser don't support SVGs and do couple of things:
That would mean text fallback for IE8. |
Correct
Yes We'll also want to add social icons: http://fontawesome.io/icons/#brand There's a lot of social icons there and I don't think we need all of them. I'll put together a list of the ones I think are most relevant to the theme in another ticket. Keep an eye out for that ticket and ignore social for now.
I think the PR should include everything the SVGs need to display properly, so CSS is probably appropriate. |
Sorry, GitHub didn't load your latest comment so I didn't see you started with Social... I guess that's okay, we'll just want to revisit the list because Font Awesome has much better social support than Genericons, which that list is based off of. Can we focus on getting the theme icons in asap? |
Do you mean removing all Genericons and replacing them using SVG icons? In #206 I'm already using Font Awesome SVG icons. Also, how much time do we have before this should be done? |
Ah — Confused because it the PR title just say "Social Menus." Can you update the title to reflect that it's all of the SVGs, just so that's clear?
@davidakennedy what are your thoughts on timeline? |
Sorry, I was still unclear. PR #206 is for using SVG icons just in social links menu at the moment. It doesn't touch other icons at all. If you want I can try to replace all Genericons and use SVGs instead in the same PR. I know it takes time, that's why asked about the timeline. |
Quoated from https://make.wordpress.org/core/2016/10/07/dev-chat-summary-october-5-4-7-week-7/ |
Thanks Ulrich. I updated PR #206 replacing all Genericons with SVG icons. Check the comments in there. |
Thanks @samikeijonen! I'll make a new issue to discuss social icon support. |
Thanks to all who have worked on this issue and pushed it forward! Thanks to @samikeijonen for leading the way with the code. In short, it's going in, and I'll work on it today. A fallback method will be needed and after reading through this post on fallbacks, it seems like the one with the widest reach will be an image fallback inside the inline SVGs. That's also nice because it does not require extra JavaScript. So that's the direction I'm leaning along with @laurelfulford, but we're happy to hear any benefits and drawbacks to this and other methods. This will be the first default theme that uses SVGs in a big way, so that's cool! ❤️ |
SVG is the emerging standard for displaying scalable icons, taking over for icon fonts. They are true icons, more acceasible, and allow for more flexibility in terms if style and layout.
This would be a good place to introduce a best-practice example of SVGs in a theme.
The only real argument against SVG at this point is backwards compatibility. This can be solved with Grunticon and other tools.
The text was updated successfully, but these errors were encountered: