#18143·astro

Mismatch with font provider `fontsource` and variable fonts

Author: openscriptCreated Sep 26, 2026Updated Sep 26, 2026
Labelspkg: astro- P3: minor bugtriage: fix pending

Astro Info

block
Astro                    v7.3.5
Vite                     v8.3.1
Node                     v22.22.3
System                   Linux (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I'm trying to use the font Inter that has a variable variant of the font. When I configure Astro to load this font via the provider `fontsource, it doesn't load the variable variant of the font.

  fonts: [
    {
      provider: fontProviders.fontsource(),
      name: "Inter",
      cssVariable: "--font-inter",
      weights: ["100 900"],
      styles: ["normal"],
      subsets: ["latin"],
      featureSettings: '"ss07", "ss08", "cv03", "cv04", "cv10"',
    },
  ]

Image ❌

Also see the corresponding Inter page on fontsource: https://fontsource.org/fonts/inter/use

The issue is, that the entry for the font on fontsource is called "Inter" but the name of the variable inter font which should be used in the font-family property is called Inter Variable.

  fonts: [
    {
      provider: fontProviders.fontsource(),
      name: "Inter Variable",
      cssVariable: "--font-inter",
      weights: ["100 900"],
      styles: ["normal"],
      subsets: ["latin"],
      featureSettings: '"ss07", "ss08", "cv03", "cv04", "cv10"',
    },
  ],

How it should look like: Image✅

If I set the name to Inter Variable in the Astro configuration the following warnings are printed:

12:06:42 [WARN] [assets] No data found for font family Inter Variable. Review your configuration
12:06:42 [WARN] [assets] Inter Variable font family cannot be retrieved by the provider. Did you mean Inter Tight?

What's the expected result?

I expect the variable font to be loaded so the necessary font features are available.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-qn9enxee

Participation

  • I am willing to submit a pull request for this issue.