-
Notifications
You must be signed in to change notification settings - Fork 273
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
Extract true vs false inconsistencies #123
Comments
The main goal for extract mode is import images from CSS/HTML: .logo {background-image: url(image.svg)}
/* compiled to */
.logo {background-image: url(sprite.svg#image-usage)} In this case you don't need any data from image expect it's final URL. But seems like users want to use external sprites from JS too. It's a feature request. |
@albertogasparin please check |
I'm sorry to say that it is not yet working. Looks like |
On top of that, the |
@albertogasparin oh shi~, thanks for reporting, fix it asap |
Fixed in |
|
Great, version 3.0.1 correctly set the What happens is that the svg generated has
I could replace the |
@albertogasparin I can suggest to add |
Ah, I see what you talking about. External sprite which will be injected in the page should not contain any styles at all. |
I have nothing against a
What do you think? Are there any other scenarios? PS: I'm just trying to help you out. At the end of the day this is your work, so feel free to ignore my suggestions, as you already did a great job with this loader 😉 |
I am almost agreed, here is my suggestion with a few updates:
In this case runtime & extract mode differs only in used JS wrapped code.
Wrong, your thoughts is important for me, as other useful thoughts from my users :) |
☝️Sounds great! |
why does the id of the icons differ in the mode ? should it not generate the same id ? #icon in runtime mode. having the sprite-loader add the -usage string to every id is very confusing |
Currently, I'm using v2.1.0 and my code looks like:
This works perfectly when
extract: false
.However, whenever I set
extract: true
,icon
is now astring
. I could check the type oficon
but the problem is thatviewBox
is no longer available.May I ask you why? Or am I using the loader in the wrong way?
PS: I read that providing a custom
runtimeGenerator
could solve my issue, however sounds a bit overkill, especially because I might need to copy-paste all default generator code, just without an if statement.The text was updated successfully, but these errors were encountered: