Skip to content

Conversation

@badwriter123
Copy link
Contributor

Hello — addressing issue #42936

This updates @font-face documentation examples to prefer WOFF2 over raw TTF. The main @font-face reference page contained .ttf in examples, and the CSSFontFaceRule and CSSFontFaceRule.style pages duplicates the same snippet, so they were updated so to keep the documentation consistent across MDN.

Thanks 😊.

@badwriter123 badwriter123 requested review from a team as code owners January 29, 2026 06:51
@badwriter123 badwriter123 requested review from chrisdavidmills and wbamberg and removed request for a team January 29, 2026 06:52
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Jan 29, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 29, 2026

Preview URLs (3 pages)

Flaws (1)

Note! 2 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Reference/At-rules/@font-face
Title: @font-face
Flaw count: 1

  • broken_links:
    • Link /en-US/docs/Web/CSS/declaration-list doesn't resolve

(comment last updated: 2026-01-29 12:09:49)

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look mostly good to me; thanks @badwriter123.

I'm guessing that there are a lot of other instances that need to be updated around the site. Are you intending to do these gradually across a set of multiple PRs?

@@ -59,6 +59,8 @@ If the `local()` function is provided, specifying a font name to look for on the
Browsers attempt to load resources in their list declaration order, so usually `local()` should be written before `url()`. Both functions are optional, so a rule block containing only one or more `local()` without `url()` is possible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The very first CSS block on this page uses .otf and .woff. Shouldn't this be updated too?

Browsers attempt to load resources in their list declaration order, so usually `local()` should be written before `url()`. Both functions are optional, so a rule block containing only one or more `local()` without `url()` is possible.
If more specific fonts with `format()` or `tech()` values are desired, these should be listed _before_ versions that don't have these values, as the less specific variant would otherwise be tried and used first.

For web delivery, it's generally best to serve fonts in WOFF2 format.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to expand this to explain why. Nothing too in-depth; just a couple of sentences?

@badwriter123
Copy link
Contributor Author

Hello @chrisdavidmills , I have updated the changes as requested. In the first CSS Block, .otf line remains to illustrate opentype features, while the last line is the web-optimized font, so we only update the old .woff to .woff2.

Also , I have explained why WOFF2 font is better to use than opentype.

Thank you 😊

Copy link
Contributor

@chrisdavidmills chrisdavidmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest changes look great to me, thanks again @badwriter123!

Merging.

@chrisdavidmills chrisdavidmills merged commit 7d63159 into mdn:main Jan 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants