netlify/postcss-fout-with-a-class

Documentation incorrect?

zachleat opened this issue · 0 comments

Hey, I love this plugin and I think it’s great! Thanks for making it!

However, I think this part of the documentation is wrong:
https://github.com/netlify/postcss-fout-with-a-class#taking-advantage-of-this

In my testing, web fonts using the FOUT with a Class approach do not block onload and as such it is not safe to add the wf-loaded class onload. Instead you need to use the CSS Font Loading API or a polyfill like FontFaceObserver to determine when the web fonts have loaded successfully.

See the example code here: https://www.zachleat.com/web-fonts/demos/fout-with-class.html