Uploaded image for project: 'Planet4'
  1. Planet4
  2. PLANET-5563

Prevent Flash Of Invisible Text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Released
    • Icon: Should have Should have
    • 2.41.0
    • None

      The fonts we load from Google Fonts don't specify the "font-display: swap" rule. As a result the text is not shown until the font is loaded, causing a flash of whitespace (aka a FOIT). This can be fixed by requesting the fonts with "&display=swap" in the url, causing google to add the property to the css response.

      The result will be that instead of flashing with no text, the text will flash with a local font instead.

      To reduce the length of this flash, we can also add a preload tag for the script. This makes sense to do as the font is needed above the fold on pretty much every page.

      tasks:

      • Add theĀ &display=swap parameter to the google fonts urls
      • Check if preload tag on the fonts has any negative impacts, if not add it.

            pvincent Pieter Vincent (Inactive)
            pvincent Pieter Vincent (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: