MaterialDesign icon indicating copy to clipboard operation
MaterialDesign copied to clipboard

Switch off SVGO Absolute for SVG / JS distribution Repos / Packages

Open OlivierLDff opened this issue 5 years ago • 4 comments

Wasn't sure where to put that or who to contact.

I'm embedding into my app all icons as svgs for easy and fast developement. I discovered a tool call svgo that optimize svg by removing meta data.

I created a github repo that mirror Templarian/MaterialDesign with optimized svg. https://github.com/OlivierLDff/MaterialDesignSvgo.

Binary size of the icon collection is reduced by half.

I want to share this repo, as it might be useful to people doing like me.

OlivierLDff avatar Oct 02 '20 15:10 OlivierLDff

We already run SVGO on all of the icon data. Can you give some examples of path data you're seeing reduced?

Make sure you're running it with 2 decimals of precision. If you have it set to round all decimals it will cause issues in some icons.

Templarian avatar Oct 02 '20 16:10 Templarian

Definitely see the difference. SVGO is configured to use absolute path data in all scenarios. This was a requirement in our legacy system to build the webfont, but we can switch it off for the SVG / JS repos after extensive testing.

Renaming your issue to point this out.

Templarian avatar Oct 02 '20 16:10 Templarian

@OlivierLDff I've tagged this for the 6.0 milestone. Not too much effort on our part, but requires extensive testing to ensure we don't cause any icon regressions. One of the underlying libraries 7 years ago had glitchy results with relative path data. Definitely not an issue with the latest @mdi/font-build package.

Templarian avatar Oct 02 '20 16:10 Templarian

@Templarian We need to verify this as we approach v6 release.

mririgoyen avatar Aug 25 '21 22:08 mririgoyen