• Resolved pingsunday

    (@pingsunday)


    Hello Tom

    I run Lighthouse, and I found this:

    Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading.
    Potential Savings (ms)
    …fonts/generatepress.woff2(pingsunday.com) 2,620 ms

    I know that generatepress.woff2 is small, but it takes 2,6s to load. How to disable it?
    I understand that it is used for the menu icon. But I don’t use the main Menu. (I can remove it). Do you have a safe way to remove this font?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Fred

    (@apzoeiruty)

    found a dirty solution
    1- Edit the file style.min.css (or edit the style.css file and recompile it after you made the changes )
    2- Remove the last line of the css which contains the following stuff :
    @font-face{font-family:’GeneratePress’;src:url(fonts/generatepress.eot);src:url(fonts/generatepress.eot#iefix) format(’embedded-opentype’),url(fonts/generatepress.woff2) format(‘woff2’),url(fonts/generatepress.woff) format(‘woff’),url(fonts/generatepress.ttf) format(‘truetype’),url(fonts/generatepress.svg#GeneratePress) format(‘svg’);font-weight:400;font-style:normal}.menu-toggle:before,.search-item a:before,.dropdown-menu-toggle:before,.cat-links:before,.tags-links:before,.comments-link:before,.nav-previous .prev:before,.nav-next .next:before,.generate-back-to-top:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1;speak:none}.cat-links:before,.tags-links:before,.comments-link:before,.nav-previous .prev:before,.nav-next .next:before{opacity:.7}.infinite-scroll .paging-navigation,.infinite-scroll.neverending .site-footer{display:none}.infinity-end.neverending .site-footer{display:block}.so-panel.widget{padding:0}#mc_embed_signup .clear{display:block;height:auto;visibility:visible;width:auto}.container.grid-container{width:auto}.main-navigation .slideout-toggle a:before,.slide-opened .slideout-overlay .slideout-exit:before{font-family:GeneratePress}
    2- You will have to rebuild or add a couple of css rules to use your own icon like this (for the menu icon it is really easy):
    .menu-toggle::before {
    content: “☰”;
    font-family: helvetica; // switch to normal fonts and nothing else needed
    width: 1.28571429em;
    text-align: center;
    display: inline-block;
    }
    .toggled .menu-toggle::before {
    content: “X”;
    }
    3- This generatepress font is used a few times only, so beside the menu css you will not get into trouble by removing this few lines.

    Watch out if you update the theme since it will put the font back into the minified version (only).
    If you prefer to keep it and remove lighthouse error just add the font somewhere else so to load it earlier.

    • This reply was modified 5 years ago by Fred.
    Theme Author Tom

    (@edge22)

    Wow, so sorry! Not sure how we missed this topic.

    GeneratePress 2.3 will have an option to use SVG icons instead of the font icons.

    Thread Starter pingsunday

    (@pingsunday)

    thank you fred, it works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove’ is closed to new replies.