hupe1980 / gatsby-plugin-webfonts

A Gatsby plugin to handle cdn, base64 and self hosted webfonts
MIT License
55 stars 0 forks source link

Both woff2 and woff are downloaded in browser #14

Open pindjur opened 3 years ago

pindjur commented 3 years ago

Correct way to include fallback formats via @font-face is this according to MDN

@font-face { font-family: "Open Sans"; src: url("/font.woff2") format("woff2"), url("/font.woff") format("woff"); }

But this plugin does following:

@font-face { font-family: "Open Sans"; src: url("/font.woff2") format("woff2") } @font-face { font-family: "Open Sans"; src: url("/font.woff") format("woff") }

which couses both formats to be downloaded.

james-baker commented 3 years ago

I noticed this today via network inspection. One <link rel="preload"... but two @font-faces in the