Templarian / MaterialDesign-Webfont

@mdi/font Dist for Material Design Icons.
https://materialdesignicons.com
Other
402 stars 157 forks source link

Move svg to another repo #49

Closed CzBiX closed 5 years ago

CzBiX commented 5 years ago

Does it possible to move svg font files to another undependent repo? It's rarely used(Only for iOS <= 4.x ?), but take 2x space than all other fonts.

svg size: 3.88M
eot + woff  + woff2 + ttf size: 1.43M

Releated info:

There's technically another container format, the SVG font container, but IE and Firefox never supported it, and it is now deprecated in Chrome.

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization

SVG Font (deprecated)

https://www.w3.org/TR/css-fonts/#font-face-src-format-types

industral commented 5 years ago

Agree. Also faced the same issue. bundle got extremely large. Need an option to build css from scss based on passed required font types, or just leave css without @font-face. User can write it's own desired @font-face and include any fonts, thanks to webpack and other build system - it's very easy bundling.

industral commented 5 years ago

Possible workaround for now is

@import "~@mdi/font/scss/variables";
@import "~@mdi/font/scss/functions";
@import "~@mdi/font/scss/core";
@import "~@mdi/font/scss/icons";
@import "~@mdi/font/scss/extras";
@import "~@mdi/font/scss/animated";

@font-face {
  font-family: "Material Design Icons";
  src: url("~@mdi/font/fonts/materialdesignicons-webfont.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

In that case webpack will bundle (or copy) only woff2 file. It's also important for those who use PWA pre-caching, where list of cached assets generated. In that case only one item will be included and cached.

Templarian commented 5 years ago

@CzBiX / @industral I actually do watch this repo, but somehow all 3 of these emails slipped through the cracks with all my travel. Unfortunately no one on the core team watches this repo, since we move issues over.

With that said you'll be happy to know SVG is being removed in the next release! Was actually going to be removed in the last release, but spaced.

Templarian commented 5 years ago

https://github.com/Templarian/MaterialDesign/issues/4166 Watch here for progress.

Templarian commented 5 years ago

@CzBiX / @industral Just so you don't miss this, the 3.7.94 release will drop SVG. Hopefully publishing to NPM tomorrow. In preview on the CDN now:

https://cdn.materialdesignicons.com/3.7.94/