locomotivemtl / locomotive-boilerplate

🚂 Front-end boilerplate for projects by Locomotive.
https://locomotivemtl-boilerplate.vercel.app/
MIT License
458 stars 71 forks source link

Add support for the CSS Font Loading API #129

Closed mcaskill closed 1 year ago

mcaskill commented 1 year ago

This pull request is based on #128. The following description was originally posted as a comment.

After some additional reading on the CSS Font Loading API and I've come up with a working example that uses Promises instead of events for a more flexible solution.

With the use of Promises, modules wait on the FontFace's they need. This way, they react accordingly if "eager loaded" or "lazy loaded".

Note that the code may not be production ready. Requires further testing across use cases and environments.

References


Added

Changed

Notes

Todo

mcaskill commented 1 year ago

Outcome from meeting on 2022-10-05

cloudflare-pages[bot] commented 1 year ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 98957eb
Status: ✅  Deploy successful!
Preview URL: https://d30919ff.locomotive-boilerplate.pages.dev
Branch Preview URL: https://feature-eager-fonts.locomotive-boilerplate.pages.dev

View logs