Skip to content
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

Guide on font preloading #7451

Open
branislavbrincko opened this issue Mar 17, 2024 · 4 comments
Open

Guide on font preloading #7451

branislavbrincko opened this issue Mar 17, 2024 · 4 comments
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. help wanted Issues looking for someone to run with them!

Comments

@branislavbrincko
Copy link

📚 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:

image

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:

image

🖥️ Reproduction of code samples in StackBlitz

No response

@branislavbrincko branislavbrincko added the add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. label Mar 17, 2024
@Jothsa
Copy link
Contributor

Jothsa commented Apr 2, 2024

I'd like to see this added as well. I might be able to do it if that's ok

@aretrace
Copy link

Yes, I been looking for this. It would be extremely useful in the docs.

@ayuhito
Copy link

ayuhito commented Apr 16, 2024

Just a heads up that I made that workaround official with a guide in Fontsource: fontsource/fontsource#963 🎉

@sarah11918
Copy link
Member

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!

@sarah11918 sarah11918 added the help wanted Issues looking for someone to run with them! label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. help wanted Issues looking for someone to run with them!
Projects
None yet
Development

No branches or pull requests

5 participants