Problem/Motivation

Whilst Google Lighthouse can only give an indication of ways to improve page rendering times and we need to interpret the results it gives for ourselves, I was surprised to see it suggesting preloading the Metropolis-Regular typeface as this is used as the "default unless otherwise stated" in the html css selector.

It is also used in views of a node's teaser as part of the meta data (for example "Read more") which is likely to appear on the front page of many sites that are likely to use the Olivero theme. This type of meta data is likely to appear "above the fold", at least on desktop browsers.

Steps to reproduce

Create a default Olivero instance and fill it with a few articles. Note the the front page will no contain several instances of the Metropolis-Regular typeface and that Google Lighthouse will suggest preloading this.

Proposed resolution

Add Metropolis-Regular to the short list of preloaded resources by adding it to the core/themes/olivero/templates/includes/preload.twig file.

Remaining tasks

User interface changes

none, other than hopefully slightly faster renderings of the page!

API changes

none

Data model changes

none

Release notes snippet

none

Issue fork drupal-3197721

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rachel_norfolk created an issue. See original summary.

rachel_norfolk’s picture

** Please note I'm going to work with a new contributor on this today, 10 Feb, if you can all give me a chance to do that before jumping in with an issue fork! :-)

Poppy_Norfolk made their first commit to this issue’s fork.

Poppy_Norfolk’s picture

I am working to make a new. issue fork.

rachel_norfolk’s picture

Excellent! We will come back to this at 1500utc tomorrow.

(In case anyone is intrigued why we are going through this so slowly for a one-line fix, I'm helping my goddaughter work through this step-by-step as a totally new Drupal user so I can see all of the hurdles a new contributor faces - and hopefully try and reduce some of those hurdles. Therefore, until we get to "Needs Review" I really need to watch every step...)

mherchel’s picture

Thanks for taking this on @Poppy_Norfolk.

Note that I'm preloading fonts that appear "above the fold". The "meta" section of node teasers and full display modes do use the "regular" variant of Metropolis, so this should probably be added.

However, once we get a patch for this, I'll want to test this out (via webpagetest), to make sure it works as expected and the request doesn't displace anything else.

Poppy_Norfolk’s picture

Status: Active » Needs review

We have added the font to preload.twig

rachel_norfolk’s picture

Assigned: rachel_norfolk » Unassigned

Heh - I don't need to lean over Poppy's shoulder any more! (removes self-assignment)

mherchel’s picture

Issue tags: +FLDC2021
mherchel’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -FLDC2021
StatusFileSize
new200 KB
new202.53 KB

This looks great to me!

Normal (no patch)

Metropolis normal preloaded

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Discussed with @lauriii and we are both +1.

Committed and pushed 0e7e67f75d to 9.2.x and 0b9972b15b to 9.1.x. Thanks!

Backported to 9.1.x since olivero is experimental.

  • alexpott committed 0e7e67f on 9.2.x
    Issue #3197721 by Poppy_Norfolk, mherchel, rachel_norfolk: Preload the...

  • alexpott committed 0b9972b on 9.1.x
    Issue #3197721 by Poppy_Norfolk, mherchel, rachel_norfolk: Preload the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.