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

feat: return font file priority #125

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

qwerzl
Copy link
Collaborator

@qwerzl qwerzl commented Feb 18, 2025

From nuxt/fonts#508.
This PR adds an additional meta.priority to FontFaceData to indicate fallback files.

@qwerzl qwerzl requested a review from danielroe as a code owner February 18, 2025 08:03
Comment on lines +79 to 83
data.map((f) => {
f.meta ??= {}
f.meta.priority = priority
return f
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have some logic to decide about increasing priority

  • 1st request: woff2
  • 2nd request: some woff2 and woff

(because naturally browser will follow priority vs extensions if in the same font-face declaration)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's exactly what I'm thinking about. Should we do it directly in unifont or in Nuxt Fonts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants