Hi, lately I was learning about SVG sprites. I did my own configuration to automate a custom design workflow with Sketch app and gulp-svg-sprite and integrate it in Sage 8.5.3 workflow (sorry for work over outdated version of Sage, I’m outdated myself).
For those wich want to design their own icon sets, it may be useful:
I’m a aethernal begginer, so sure it can be improved a lot. Any comments, critics and improvements are welcome.
Thanks, @strarsis! I have no much knowledge about HTTP/2. As far as I know, multiplexing make sprites mostly useless. For an HTTP/2 strategy, maybe will be better to come back to separated SVG files, since they can be requested asynchronously.
In that case, another workflow would be configured without gulp-svg-sprite. Just gulp-sketch will be enough to create SVG files and Mustache to create a scss template. Indeed, at this moment, separated SVG are created at your-theme-dir/custom-icons-for-sage/dist/images/.
As I said, I don’t have much knowledge about it. Any thought will be welcome.
I doesn’t hurt to have everything all in one file, but I’d say with http2 correctly configured you might not need sprites. Would probably be such a small difference I’d say use the tool that works for you!
For our Sage 9 sites, I made an @icon blade directive that just grabs the file contents of an icon.blade.php file that actually just has SVG code, so I can inline everything. No requests, and the code is THEN in the page cache, which is the quickest usually
I think so, I primarily use it to inline SVGs, so it should work fine for that. Never used it with sprites, but I don’t see any reason why they wouldn’t work.