-
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
Font is not loading #75
Comments
Would you be able to provide a reproduction? 🙏 More infoWhy do I need to provide a reproduction?Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. What will happen?If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If How can I create a reproduction?We have a template for starting with a minimal reproduction: 👉 https://stackblitz.com/github/nuxt/fonts/tree/main/example A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as minimal as possible. See more details in our guide. You might also find these other articles interesting and/or helpful: |
I can't reproduce this. Would you be able to provide a minimal project with this issue? |
@danielroe sure. I'll share ASAP. |
@maxdzin is it working with I reported an issue recently with fonts on twitter and I promised to come up with a reproduction. (@danielroe)
Please note: Originally I reported on twitter as potentially an issue with AWS amplify hosting (which you can see deployed here) but as seen in the stack blitz, it isn't loading there on build either. The font in question is: https://fonts.google.com/specimen/Press+Start+2P |
@danielroe Thank you, Daniel! I created a reproduction: https://github.com/maxdzin/nuxt-fonts-test The problem is that the fonts are not loaded even though they are specified in
and then this warning right after it:
Apart from that issue, I also trying to achieve dynamic font style switching. Environment details:
|
@robokozo No, it doesn't work. Neither for dev or build. |
@maxdzin I tried creating a minimal repo with the font you're trying to use + tailwind but it was working correctly for me. https://stackblitz.com/edit/github-qda5kf |
@robokozo thank you, that seems helps to understand the problem better. Today I tried to investigate again and here's what I found: And that setup seems related to the environment: I tried to use Codesandbox, where node v20.9.0 and pnpm package manager is used. And there is where we can reproduce that issue. |
Update I've managed to resolve this issue by some changes in tailwind config: export default <Partial<Config>>{
...
theme: {
extend: {
...
fontFamily: {
- sans: ['Inter', ...defaultTheme.fontFamily.sans],
+ sans: ['"Inter var"', ...defaultTheme.fontFamily.sans],
},
},
},
...
} I'm not sure about the difference between specifying 'Inter' or 'Inter var': whether that's not a problem with this module and it is the right behavior, or there's something to consider regarding that. So, I'll try to investigate later. |
This seems to be working fine for me with node v20.12.2 and pnpm. I suspect it's a caching issue or was fixed subsequently to your reproduction. I'm going to close this but if you can reproduce again, please do let me know and I'll reopen. 🙏 |
@danielroe Thank you 🙏 |
Hello guys!
I followed the documentation and tried a couple of settings/scenarios, but cannot make it work in some of my Nuxt projects - the font is not loaded.
There's used tailwindcss, so the font family is specified there;
but the font is not loaded and just used system default.
I also tried to specify it within my
main.scss
file (that is specified innuxt.config.ts
, of course):But that doesn't help.
As well as trying some fine-grained settings in the Nuxt config file:
as well as this:
I see there are a few other issues that mention some problems with the variable font (and I'm trying to use
Inter
which is variable), so I'm not sure if it's related to some variable font support issue (if any) or there is something else.I would be grateful if you could point this out to me.
The text was updated successfully, but these errors were encountered: