Resolved

Cumulative Layout Shift (CLS) bad index

Polestar Theme started by Feliciano B.V. Dec 2, 2021 3 replies
Feliciano B.V. Dec 2, 2021 · 7:32 pm #16352

Hi,
to improve the Google index “Cumulative Layout Shift (CLS)”, I need to remove the fonts:

    polestar-icons.ttf
    polestar-icons.woff

Or Preload web fonts, or include “font-display: swap” in the @font-face style.
(https://web.dev/font-display/)

How can I do it?

Thanks,
Feliciano

Andrew Misplon Puro Dec 2, 2021 · 7:51 pm #16353

Hi Feliciano

Thanks for reaching out.

I’m not sure font-display has a valid place when it comes to icon fonts. I don’t know that the tool being used can tell the difference between a font used for normal text and a font used for icons. A more detailed explanation of the issues surrounding font-display and icons can be found here: https://www.zachleat.com/web/font-display-icon-fonts/.

To remove the icon font family, the following can be inserted using the Code Snippets plugin or a child theme functions.php file:

function polestar_child_dequeue_assets() {
  wp_dequeue_style( 'polestar-icons' );
}
add_action( 'wp_enqueue_scripts', 'polestar_child_dequeue_assets', 11 );

If using Code Snippets you can set the snippet to run on the site front end only. Save and Activate when done.

The icons that will no longer be available can be seen here: https://github.com/purothemes/polestar/blob/develop/css/polestar-icons.css#L26-L142.

Feliciano B.V. Dec 3, 2021 · 10:16 am #16355

This reply has been marked as private.

Andrew Misplon Puro Dec 3, 2021 · 10:50 am #16356

Hi Feliciano

Glad to help.

Do you have drop-down menu items? Would you like to remove the down arrow that will be missing if you use the function above?

4 posts
Closed This topic is closed to new replies. Still stuck? Start a new topic in Polestar Theme.