GoogleChrome / GoogleChrome/lighthouse

Font-Display check should consider icon fonts

Open
#10,127 10 comments 6 reactions 1 assignee Claimed by @kaycebasques View on GitHub
docs P2
Dominant language
JavaScript
Stars
30.8k
Forks
9.8k
Avg merge
1d 20h
Merged PRs (30d)
19

Description

**Feature request summary**
A special check to not recommend `font-display: swap` for icon fonts.

**What is the motivation or use case for changing this?**

There seems to be no clear recommendation on what is actually best practice for icon fonts, and even if there is, it's not `swap` but actually `block`. So I would suggest either adding a special rule to to detect icon fonts or maybe whitelist the most common ones so they don't trigger the lighthouse warning when `swap` is not set.

Relevant links:
- https://github.com/FortAwesome/Font-Awesome/issues/14387
- https://www.zachleat.com/web/font-display-icon-fonts/
- https://stackoverflow.com/questions/49461308/correct-font-display-value-for-icon-fonts

**How is this beneficial to Lighthouse?**

Currently the Lighthouse recommendation is not actual the best practice and might cause people blindly following it to get unintended behaviour.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.