I want to improve Google Lighthouse score of a web application built using Vuetify.
To increase the performance score, I have been trying to get rid of the diagnostics:
Ensure text remains visible during webfont load
Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. Learn more
URL: https://cdn.jsdelivr.net/npm/@mdi/font@latest/fonts/materialdesignicons-webfont.woff2?v=4.5.95 (cdn.jsdelivr.net)
This outcome was also for installing Roboto
through https://fonts.googleapis.com , and it disappeared when I added display=swap
to the links as follows:
<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin>
<link
rel="preload"
as="style"
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"
crossorigin>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900&display=swap"
crossorigin>
However, apparently, it does not make any difference to add display=swap
to MaterialDesignIcons css file like:
<link
rel="preload"
as="style"
href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css?display=swap"
crossorigin>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css?display=swap"
crossorigin>
Doing so, the diagnostics item does not vanish. How should I load materialdesignicons.min.css
so that the text remains visible during webfont load?