Add in xlink to the namespace to allow a more reliable icon-sprite.sv… #2116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Update the
grunt/svgstore.js
file to add in thexlink
namespace to provide a more reliable build.Currently some svg files will cause the created single
icon-sprite.svg
file to stop working when referenced in the templates via<svg><use xlink:href="#icon-GiftCertTest" /></svg>
method.Requirements
Tickets / Documentation
Relevant conversation here where users are mentioning to removing various elements of the source svg files to get it to work - however, adding this into the build allows a much greater range of svg files to be used.
#1246
Screenshots (if appropriate)
Screenshot of a broken
icon-sprite.svg
after adding an additonal svg fileTo replicate a failed build.
assets/icons
directory and run thegrunt svgstore
command with the default configuration.icon-sprite.svg
will be created, but if you view it in MacOS finder you will see the error message (as per above screenshot)svg
chevrons in the menu etc are now no longer visible.icon-xxx
of the svg below and note it is not loaded.grunt/svgstore.js
file with the adjusted, and rungrunt svgstore
again. All should be ok!Credit:
Please note I did not create this file - it is from Giao at Papathemes and all credit should go there!