Site logo

Archived topic

CLS Issue with Lightweight Social Icons

9 replies · Started by Dan on March 23, 2021

Viewing posts 1–10 of 10

Hello, on this site, https://adventuresofmel.com/ I am using lightweight social icons, it is the only source of CLS issues for this site. Is there a way to implement the social icons in the widget areas without using the plugin as it seems it's been abandoned? I just need simple icons like the plugin provides that doesn't kill the site with CLS issues.
Thanks

Hi there,

You can try 2 things.

You can try to preload its fonts by using this code on a Hook Element hooked to wp_head.

<link rel="preload" href="https://adventuresofmel.com/wp-content/plugins/lightweight-social-icons/fonts/fontello.woff" as="font" type="font/woff2" crossorigin>

or you can prevent FOUT by editing the plugin's CSS file.
https://wordpress.org/support/topic/preload-font-fontello-woff/#post-14092979

Hey, I tried what you suggested and the CLS issues still remain. If I remove the plugin they still all go away.

Hi there,

try adding this CSS to your site:

.lsi-social-icons {
  min-height: 52px;
}

It should preset the height of the container so it doesn't rely on the loading of the icons to define its height.

Thanks! That solved 99% of the issues, there is still some very small issue with each of the icons not. But it's negligible.

Try updating the CSS to this:

.lsi-social-icons {
  min-height: 52px;
}
.lsi-social-icons li {
  min-height: 40px;
}

Hey, this actually worked perfectly this time, Thank You!

Glad to hear that!

I need to apply the same fix but I don't know where or how to add something to the CSS. Can you show me where I add this? Thanks

This archived topic is closed to new replies.