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
add a new mode that combines the view and the symbol mode. #81
base: main
Are you sure you want to change the base?
Conversation
…e use of 'use'-tags, filesize increases only very little
maybe the name of the new mode should be changed to combined, or something else, but the idea is to be able to reference symbols via use tags in the html and to be able to use the same spritesheet via the help of the generated positions (view mode) in css for e.g. in an ::after selector. |
Hi @flobacher, thanks for these suggestions. Due to my current workload (and some travels the next days) I'll probably not be able to review this before mid of next week. Thanks for your patience! Cheers, Joschi |
Hi Joschi, no need to hurry. just think such a combined spritesheet is realy handy. hope you like it! Cheers, Flo Zitat von Joschi Kuphal notifications@github.com:
|
I just renamed the mode to universal, because its universal nature (symbols, views and positions all in one spritesheet) reminded me of the universal module definition pattern for js modules. I hope you think as well, that this is a better name for this mode. |
Hi @flobacher, first of all sorry for not being more responsive! It really took me until now to find the time to thoroughly review your suggestions. Although there are some parts that I would solve a little different, I really like your approach. In fact I wonder if we couldn't even take this a little further. Let me explain:
So why not generally configure a sprite by combining "flags" like this (hope you understand the EBNF like try of an explanation):
In words:
This could elmininate the need for the different modes altogether and make the configuration more like a flag based process. Maybe that's a lot simpler than the current way of configuring. What do you think? Looking forward to your thoughts! Cheers, |
Hi @jkphl, |
Hey @flobacher, |
Great!!! Let me know, if you need any help! Cheers, Zitat von Joschi Kuphal notifications@github.com:
|
This is exactly the functionality I'm after. I'm currently moving to a symbol workflow but would like to retain the ability to use the CSS method as well. Will just have to have 2 output modes for now :( |
@flobacher @Kreeg I rebased this and updated to match the current code, but, unfortunately, I can't push to @flobacher's master branch: https://github.com/svg-sprite/svg-sprite/compare/pr/81 We still need tests, though. |
@XhmikosR do you mean screenshot tests? |
Whatever tests are needed, not sure exactly. I just don't see any tests is all :) If you plan to land it later @Kreeg I guess we should close this PR and you use the branch I pushed to our repo. |
@XhmikosR ok i will land it later. And I will close this PR then. For now I think it should be opened |
Update: https://pastebin.com/raw/Hcd18qP5 This is result thi the same input with view mode in tests |
@Kreeg I usually work with symbol mode via the following markup
I don't think referencing a symbol from an svg works via img tag.. |
@flobacher Ok I'll what we can do here. The problem here is in tests. There is a browser ( |
@Kreeg use a standard url, so relative path or absolute (including the protocol https:// ) using file:// should not be necessary |
@Kreeg hm.. looks like this is because of the gradients that are also referenced via id |
Maybe this is related #74? |
4a81a1c
to
a218216
Compare
through the use of 'use'-tags, filesize increases only very little
TODO: