Closed CzBiX closed 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.
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.
@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.
https://github.com/Templarian/MaterialDesign/issues/4166 Watch here for progress.
@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:
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.
Releated info:
https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/webfont-optimization
https://www.w3.org/TR/css-fonts/#font-face-src-format-types