Support for the new google fonts CSS API
-
Hi,
Google has changed the way that it suggests to to embed a font into the <head> of your html (using the new CSS api)Expected Behaviour:
- Autoptimize to inline google fonts (using the new css api url structure) into a single combined request
Current Behaviour:
- Autoptimize strips out the themes/plugins enqueued google url from the head of the document.
- It doesn’t recognise the font families and font weights for stylesheets requests made using the new url structure.
- It doesn’t include requests for those google fonts in an optimized request
How to reproduce:
- Output google fonts as normal in the document head of the theme using the new google fonts css api (e.g.
https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400&family=STIX+Two+Text:ital@0;1&display=swap
) - Enable google fonts optimization in the plugin
- Notice that the stylesheet has been stripped out of the document head and no optimized request is made.
Thanks ??
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Support for the new google fonts CSS API’ is closed to new replies.