Font-display: swap to fix the “Ensure text remains visible…” issues
-
Hi all!
I am looking to solve the “Ensure text remains visible during webfont load” PageSpeed issue. I am aware that font-display:swap does the job, but there was never a @font-face rule in my theme code, so I′m trying to add it now.
I don′t think any fonts were ever uploaded to the website, so I′m not sure where to start here.
I tried going through the suggestions PageSpeed audit provided me with to eliminate those fonts, so I came up with this query (for one of the fonts):
@font-face { font-family: 'Poppins'; src: url (https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJfecnFHGPc.woff2 ) format('woff2'); font-display: swap; }
However, it didn′t remove this specific font from the issue pane. Do I have to specifiy font-style and font-weight? In that case, how can I know what are those exactly – I′m using a bunch of font weights on my pages.
Besides, there are also some Roboto fonts that I′m not using at all – is there a way to rather eliminate them completely?
I would be really thankful for some direction here – I′m familiar with a few webdev basics, but am still a very rookie level.
- This topic was modified 2 years, 3 months ago by . Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
The page I need help with: [log in to see the link]
- The topic ‘Font-display: swap to fix the “Ensure text remains visible…” issues’ is closed to new replies.