• Hello,

    I’ve optimized my sites like crazy, and get good Mobile Pagespeed scores, except I’m constantly failing the FCP (First Contentful Paint) and LCP scores on mobile with Google and keep getting warnings because they are over 2.5 seconds. (Even though just barely over)

    I’ve read that you can add font-display:swap in your @font-face style to avoid FOIT and possibly dramatically help FCP scores.

    Is there a way to do add this in GeneratePress?

    Thanks!

    • This topic was modified 2 years, 9 months ago by lpe04.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi there,

    in the Dynamic Typography options you can set the display rule:

    https://docs.generatepress.com/article/dynamic-typography-overview/#google-font-display

    Dynamic typography was added in GP 3.1
    Sites that updated to 3.1 have to enable the option:

    https://docs.generatepress.com/article/switching-to-dynamic-typography/

    Please note: using Display Swap may cause CLS.

    Thread Starter lpe04

    (@lpe04)

    Ok, thanks!

    For some reason one of my sites I have those new options under Customizing -> General, (an option for the new Dynamic typography and also an option to combine CSS) but on my other site, which has GeneratePress as well, and is updated to same version, I don’t see those options under Customizing -> General.

    The only option is for Cache Dynamic CSS.

    Hi @lpe04

    For the sites that doesn’t have the option, it’s likely because the site’s initial GP version is already the one where the Dynamic typography is the default typography setting.

    The option itself only shows up for sites that initially used an older version of GP (versions prior to Dynamic typograhy) but then updated to the newer one w/ the Dynamic typography.

    Tom added this option for older users who want to update the theme but wants to keep the old typography settings.

    This option isn’t available for newer users who are just installing the theme now for the purpose of eventual complete obsoleting of the old typography system.

    Thread Starter lpe04

    (@lpe04)

    Thanks Elvin!

    Two part question,
    1) For my second site which doesn’t need to migrate to the new system, why don’t I see the option under General to “Combine CSS” files? This option sounds like it would help performance.

    2) Ok, so for my sites, I don’t have any font selected when I go to font manager. I’m just using whatever the GeneratePress default fonts were, I never messed with these, and am happy with how they look.
    For performance and improving FCP, should I leave this alone, or would it be more advantageous to select a font (such as Arial), and then check the box for Google fonts, and then set Google font display to either swap or optional?

    Thanks again!

    1) For my second site which doesn’t need to migrate to the new system, why don’t I see the option under General to “Combine CSS” files? This option sounds like it would help performance.

    For the newer versions of GP, it’s already combined by default.
    https://docs.generatepress.com/article/combine-css/

    For #2, not having any font selected on the typography settings means the theme is using System stack.

    System stack fonts is the best in terms of performance because the site doesn’t have to load any font-file and is relying on whatever font is installed on the client side’s computer. ??

    If you’re fine w/ how it is now then you can keep that setting because that’s also the best scenario in terms of performance. ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding font-display:swap to GeneratePress’ is closed to new replies.