-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Auto-inline SVGs #4763
Comments
Looking forward for this too, to be able to inherit color from CSS properties as we do with webfonts. A good starting point could be to analyze Angular Material Icon SVG management and MatIconRegistry, which allow to create a sprite of SVGs and inline them where needed. Talking about alternatives, #2894 won't do, because it doesn't manage dynamic bindings. |
Hi guys, don't have time atm to read the exact request, but putting this here if it helps (extract from docs, currently not deployed yet):
QIcon/DynamicSvg here: https://github.com/quasarframework/quasar/blob/dev/docs/src/examples/QIcon/DynamicSvg.vue |
I think it's not exactly the same thing we are searching, but it's a nice step forward! |
Don't need to wait for the release. This already works in 1.0 |
@rstoenescu So something like
Should work, right? |
What we mean by "inline SVG" we mean inlining it into HTML, not having to inline it into the Also it doesn't take into account CSS rules inherited from parents like color, I guess? Ideal API, for me, should be <q-icon svg-inline name="static/icon.svg"/> Which renders to <svg class="q-icon svg-icon">
<!-- SVG icon content -->
</svg> Does this make sense for you? All in all, I keep suggesting to check Angular SVG Icons as its a very well designed system, with Icon Sets saved as an SVG of named SVGs |
I use vue-svg-inline-loader but it will only work with native img tags like so: +1 for a feature to inline SVGs in QIcon, QImg and others. |
It actually works pretty well, except the fact that referencing them with |
@IlCallo it works up until you start using dynamic urls like `../my_folder/{myVariable}.svg` Or trying to insert those inside |
Well, of course, given that it's done at build time. |
oliverfindl/vue-svg-inline-loader#2 (comment) Here the maintainer of This is pointed out to be a possible solution for now, even if it seems a bit verbose to me. |
Going to bring this up again. So I have a fairly large number of custom icons in my project. And I really love the way QIcon handles working with icons. My current approach is to create a separate
This works fine and as expected but looks a bit (a lot) cumbersome. Especially when I have to use a custom icon somewhere inside another Quasar component. So I stumbled upon The issue is colours. This approach does not support propagating colours to my icons. All icons would just default to black. In discord channel @rstoenescu suggested I add No matter the reason, this significantly limits my approach to using custom icon library (bare in mind, it's a number of svg files, not a web-font) in my project. As the number of custom icons grows (and the number of icons used from 3rd party vendors, that are already included in quasar-extras, shrinks) - this is becoming more and more of a concern to me. What makes matters worse is the inability to use even my current approach (svgs inside separate functional vue components) in some Quasar components. Most of this can be (and is) bypassed through |
I am closing the issue for inactivity. If this is still a concern, please create a conversation in the Discussions area or feel free to reopen. |
Everything is described in this comment:
#2494 (comment)
The text was updated successfully, but these errors were encountered: