Site logo

[Resolved] CLS Issue with Lightweight Social Icons

Home Forums Support [Resolved] CLS Issue with Lightweight Social Icons

Home Forums Support CLS Issue with Lightweight Social Icons

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1706799
    Dan

    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

    #1707241
    Elvin
    Staff
    Customer Support

    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

    #1707588
    Dan

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

    #1707783
    David
    Staff
    Customer Support

    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.

    #1707808
    Dan

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

    #1708130
    David
    Staff
    Customer Support

    Try updating the CSS to this:

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

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

    #1727497
    David
    Staff
    Customer Support

    Glad to hear that!

    #1750507
    Melanie

    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

    #1750565
    David
    Staff
    Customer Support

    Hi there,

    that code may need to differ for your particular site.
    But you can give it a try.

    This doc explains some methods for adding CSS:

    https://docs.generatepress.com/article/adding-php/

    But the simplest method is to copy the code provided here:
    https://generatepress.com/forums/topic/cls-issue-with-lightweight-social-icons/#post-1708130

    Go to Customizer > Additional CSS in the field, start a new line and paste the code in there.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.