Closed branislavbrincko closed 1 month ago
I'd like to see this added as well. I might be able to do it if that's ok
Yes, I been looking for this. It would be extremely useful in the docs.
Just a heads up that I made that workaround official with a guide in Fontsource: https://github.com/fontsource/fontsource/pull/963 🎉
Hi there! This seems like a helpful addition, and if the workaround exists in Fontsource docs now then perhaps linking to it rather than reproducing it here makes sense from a maintenance perspective.
I would be happy to receive a PR to add this extra helpful content to the docs! We don't "assign" issues to people in this repo, but are happy if you'd like to use this thread to coordinate or express intention to follow through.
So I will add help wanted
to this issue to indicate that anyone is free to contribute! Thank you for raising it!
Pinging this for freshness! Linking to the now-existing guide is still up for grabs as a docs PR if anyone is interested!
📚 Subject area/topic
Using custom fonts
📋 Suggested page
https://docs.astro.build/en/guides/fonts/
📋 General description or bullet points (if proposing new content)
Include information on how to add font preloading.
When a new Astro project is scaffolded using the blog template,
BaseHead.astro
includes font preloading:It would be beneficial if the documentation for setting up fonts included a similar example.
For the local font file setup, all that is needed is to add lines like the ones above.
For Fontsource library the setup is little bit more complicated. There's seems to be no default way how to do this in the Fontsource but there is a workaround which seems to be working very nicely in Astro.
The Astro guide could include something like:
🖥️ Reproduction of code samples in StackBlitz
No response