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 use my own set of inline SVG for icons so I can share and bundle them within my app
I use your wl-expander
Now I need to load the entire Material Icons font just for the glyph on the wl-expander. I also have issues around the Material Icons font being a render-blocking resource for the page (reported by Lighthouse), and I also have to deal with Flash-of-un-styled-text, etc in slow network conditions.
If you use inline SVG, now the icon is bundled with the source, and I don't need to worry about loading the font, or any of the accompanying issues.
By far the best option as I see it is to make all icons in other components slots - it gives way more flexibility to anyone using the components. Given how many different options there are for icons, trying to find a solution that fits everyone without just delegating seems like a fool's errand. Defaults are another thing, of course - filling the slot with wl-icon seems like a sensible default. Given that, it seems like a good solution in general.
Of note is that the select component uses inline SVG as you describe (but, by contrast, has no option to customise it at all).
Meaning that there is no way to override the <wl-icon>.
Is it also reasonable to omit import "../icon"; (to reduce code size if using a different approach) and leave it up to the parent project to import it... seeing as we have to manually import the font anyway.
Consider this scenario:
wl-expander
Now I need to load the entire Material Icons font just for the glyph on the
wl-expander
. I also have issues around the Material Icons font being a render-blocking resource for the page (reported by Lighthouse), and I also have to deal with Flash-of-un-styled-text, etc in slow network conditions.If you use inline SVG, now the icon is bundled with the source, and I don't need to worry about loading the font, or any of the accompanying issues.
For example:
Instead of:
And (in expansion.ts):
I guess the down-side is that there may be increased file size for projects that do use
wl-icon
and the Material Icons font.Perhaps you would export a set of SVG icons that are used within Weightless so that they can also be shared/bundled in the parent project.
Thoughts? Is this good or have I got the wrong idea here?
The text was updated successfully, but these errors were encountered: