Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
282 stars 76 forks source link

refactor(vtmn/icons): reorder font src, woff2 in first position for performance #1388

Closed jquinc30 closed 1 year ago

jquinc30 commented 1 year ago

Changes description

Reorder src of vitamix @font-face

Context

The browser download and use the first font file supported so the order is important to ensure best performance. Before is was ttf, woff, woff2 so the browser use the ttf version (62K) After it's woff2, woff, ttf so it will take the woff2 version which is better (26K, 59% lighter 🚀 )

NB: it's a progressive enhancement, for oldest browsers that doesn't support woff2 nor woff, they will continue to use the ttf version as before

Checklist

Does this introduce a breaking change?

Other information

lauthieb commented 1 year ago

Thanks a lot @jquinc30 for your precious advice!

Tlahey commented 1 year ago

Nice catch @jquinc30 :)