font-display: swap
-
I added
font-display: swap
to line 132 of the fontmanager.php file so I get a little more love from the Lighthouse optimize scan thingie. :)
$newfontsCSS .= '@font-face{ font-family: "'.FontManager::$customFonts[$i]['fontname'].'"; src: url("'.$url.'") format("'.$fileformat.'"); font-display: swap; } ';
Maybe something to put in the source code permanently?
-
Dear @iamerwin
An Update:
Armin is delayed currently, sorry that he hasn't responded yet, A follow up on your issue will come as soon as possible.Once again sorry for the inconvenience & if i can help further let me know :)
Best wishes
Richard -
"Instructs the browser to use the fallback font to display the text until the custom font has fully downloaded. This is also known as a “flash of unstyled text” or FOUT."
not sure if i want a flash of unstyled text
i believe you can just use this custom css in lay options -> custom html&css:
body{
font-display: swap;
}that should work and this way your change in the php file wont be overwritten when you update lay theme next time
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it