-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Includes an excessive amount of font files when using tailwind #443
Comments
I too noticed this strange behaviour. |
I made a quick test and initialized a fresh started nuxt with project with only the fonts module installed.
body {
font-family: "Inter";
}
export default defineNuxtConfig({
compatibilityDate: "2024-11-01",
devtools: { enabled: false },
modules: ["@nuxt/fonts"],
css: ["~/assets/main.css"],
}); The output is the same described by @cadamsdev Here's a sample screenshot (left Nuxt Fonts, right Google Fonts) |
Unfortunately I have the same issue: main.css: @import "tailwindcss";
@theme {
--font-sans: 'Inter', sans-serif;
--font-serif: 'Merriweather', sans-serif;
} Even tho I tried to regulate what fonts should be included:
|
Problem
When using nuxt/fonts with the tailwind module, I'm seeing nuxt/fonts adding an excessive amount of font-faces to the global stylesheet. It's also downloading 32 font files when I'm only using 1 font and 1 font weight "400". It's downloading a font file for each font-weight, variable font, italicized versions and woff format.
Expected
Actual
Steps to reproduce
npm run generate
You can see its downloading 32 font files.
dist/index.html
you can see it's adding more font-faces than we need.Minimum reproduction
https://github.com/cadamsdev/nuxt-fonts-tailwind-issue
The text was updated successfully, but these errors were encountered: