mui / mui/material-ui

[docs-infra] Fix font best practice

Open
#43,749 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

docs performance scope: docs-infra type: enhancement
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Steps to reproduce

However, this doesn't seem to be a best practice, see https://www.debugbear.com/blog/website-font-performance#self-host-your-web-fonts for why. The problem really boils down to having to make a CSS network request to then be able to load the font. Since 2021, all browsers have implemented cache partitioning, so there are no more CDN performance benefits.

There is a reason why https://nextjs.org/docs/app/building-your-application/optimizing/fonts and https://docs.astro.build/en/guides/fonts/ don't mention it.

For example, compare https://dashboard.tremor.so/overview load to https://mui.com/material-ui/getting-started/templates/dashboard/. What we do is not at the quality level, we need to set.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/pages/_document.js, especially the Google Font loading around line 81, then review the Google Web Fonts guidance in the Typography documentation. The work is complete when font loading uses an appropriate fallback strategy and the docs explain when Google Fonts are suitable for testing but not production.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, javascript, next.js
Domain
documentation, performance, web-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.