Skip to content

Conversation

@florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Jan 23, 2026

Description (required)

Some questions left:

  • I left some TODO:s in the configuration reference. In the experimental page, there were headings for "Granular font configuration" and "Caching" that I feel would belong where I put them. But I don't feel like I can easily make a section for them there. So yeah not sure what to do
  • I updated the fonts guide and added the Fonts API at the end, matching what we've done for astro:env. However here I'm wondering if it wouldn't make sense to have it first as it's easier and more powerful (vs. the env guide which has a bunch more things that are absolutely mandatory first)

Related issues & labels (optional)

  • Closes #
  • Suggested label:

For Astro version: 6.0.0. See astro PR #15291.

@netlify
Copy link

netlify bot commented Jan 23, 2026

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 0f88b70
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/697910bf491619000811afad
😎 Deploy Preview https://deploy-preview-13107--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jan 23, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/fonts.mdx Source changed, localizations will be marked as outdated.
en/guides/upgrade-to/v6.mdx Localization changed, will be marked as complete.
en/reference/configuration-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/error-reference.mdx Source changed, localizations will be marked as outdated.
en/reference/errors/cannot-load-font-provider.mdx Source removed, will stop being tracked.
en/reference/errors/experimental-fonts-not-enabled.mdx Source removed, will stop being tracked.
en/reference/experimental-flags/fonts.mdx Source removed, will stop being tracked.
en/reference/font-provider-reference.mdx Localization added, will be marked as complete.
en/reference/modules/astro-assets.mdx Source changed, localizations will be marked as outdated.
es/reference/errors/cannot-load-font-provider.mdx Localization removed, will be marked as missing.
es/reference/errors/experimental-fonts-not-enabled.mdx Localization removed, will be marked as missing.
fr/guides/fonts.mdx Localization changed, will be marked as complete.
fr/reference/error-reference.mdx Localization changed, will be marked as complete.
fr/reference/errors/cannot-load-font-provider.mdx Localization removed, will be marked as missing.
fr/reference/errors/experimental-fonts-not-enabled.mdx Localization removed, will be marked as missing.
fr/reference/experimental-flags/fonts.mdx Localization removed, will be marked as missing.
ja/guides/fonts.mdx Localization changed, will be marked as complete.
ko/guides/fonts.mdx Localization changed, will be marked as complete.
ko/reference/error-reference.mdx Localization changed, will be marked as complete.
ko/reference/errors/cannot-load-font-provider.mdx Localization removed, will be marked as missing.
ko/reference/errors/experimental-fonts-not-enabled.mdx Localization removed, will be marked as missing.
ko/reference/experimental-flags/fonts.mdx Localization removed, will be marked as missing.
zh-cn/guides/fonts.mdx Localization changed, will be marked as complete.
zh-cn/reference/error-reference.mdx Localization changed, will be marked as complete.
zh-cn/reference/errors/cannot-load-font-provider.mdx Localization removed, will be marked as missing.
zh-cn/reference/errors/experimental-fonts-not-enabled.mdx Localization removed, will be marked as missing.
zh-cn/reference/experimental-flags/fonts.mdx Localization removed, will be marked as missing.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jan 23, 2026
@florian-lefebvre florian-lefebvre marked this pull request as ready for review January 23, 2026 16:00
@florian-lefebvre florian-lefebvre self-assigned this Jan 23, 2026
@sarah11918 sarah11918 added improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) 6.0 labels Jan 23, 2026
@sarah11918 sarah11918 added this to the v6.0.0 docs milestone Jan 23, 2026
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

So exciting! As discussed, the guides page can be a rewrite focusing on just the Fonts API as now the only documented way to do fonts in Astro! 🎉

So, I only looked through the other pages to see what the content split looked like.That leaves us with:

  • Guide page: pretend the existing content never existed, and just guide people to go from "no font" to "font" with this new feature. Use the Related recipe component if you want to salvage existing content and make them separate individual recipe pages.
  • v6 upgrade: ✅
  • font provider reference: ✅ (minor comments)
  • config reference: The opening is way too long; most of that is the stuff that should be incorporated into the guide page (see my comment) because it's explanatory, tells people what they need to know about the feature but links out to the heavy lifting details.

Astro exports built-in font providers from `astro/config`:

```js
import { fontProviders } from 'astro/config'
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean we need an entry on the astro:config page for fontProviders @ArmandPhilippot

Copy link
Member

Choose a reason for hiding this comment

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

Another ping that GitHub saw fit not to notify me of... 🙄

I guess we could have a new section for astro/config imports but this one is a bit tricky because it contains a mix of things documented elsewhere:

import { defineConfig, envField, fontProviders, getViteConfig, mergeConfig, passthroughImageService, sharpImageService } from 'astro/config'

I'm not sure how helpful it is? Maybe as an overview of what is available for someone who don't know how to find the appropriate page?
But since we are not displaying the astro/config exports at the moment, we probably should do that in another PR, with the others, so that it doesn't seem strange to have only one export here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we create an issue for this so we don't forget?

Copy link
Member

Choose a reason for hiding this comment

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

I added that to my TODO list, so I'll get to it at some point (maybe next week). So, not necessarily? But if we want to give someone who wants to help a chance, yes, we can create one!

@sarah11918 sarah11918 added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Jan 23, 2026
Copy link
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

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

Thanks Florian, this looks great! (hope you'll translate all that 😄 )

I left a few suggestions, mostly nitpickings. For the fonts guide, we might want code snippets that work "out of the box".

What I mean is: when learning a new feature, you might want to copy/paste the code snippets in a new project and get something working without asking yourself what you're doing wrong. So, we might need to develop a bit the code snippets (minimal layout, imported Layout).

This is based on a feedback shared by HiDeoo for content collections, and we improved that for v6. Since, we're rewriting the fonts guide, we could take this opportunity to do the same!

I've only suggested changes for "Using a local font file", but we could do the same for "Using Fontsource".

My suggestions in the Font Provider reference are only for consistency (backticks for code).

Copy link
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

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

Rereading the font guide, I noticed we're still talking about @font-face while this is now something implemented under the hood. Maybe, we should reword those steps because the user don't need that to use the Font API?

Registering custom fonts for your Astro project is done through [the `fonts` option](/en/reference/configuration-reference/#fonts) in your Astro config.

For each font you want to use, you must specify its name, a CSS variable, and an Astro font provider.
For each font you want to use, you must specify its [name](/en/reference/configuration-reference/#fontname), a [CSS variable](/en/reference/configuration-reference/#fontcssvariable), and an Astro font provider.
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe need to also add a link for the provider property?

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Aprooooooove! Depending on how quickly you want this merged, we could get some final boss reviews from Yan and Armand. But I think this ticks all the boxes. Great job, Florian!

Copy link
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

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

This looks great, Florian! 🙌🏽
Some of the highlighting in the Font Provider API tabs is wrong, but otherwise LGTM!

Co-authored-by: Armand Philippot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.0 i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! improve or update documentation Enhance / update existing documentation (e.g. add example, improve description, update for changes) merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants