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

Option for ordering in head? font faces loaded before fonts are loaded, results in annoying warning #58

Closed
awacode21 opened this issue Mar 14, 2022 · 8 comments

Comments

@awacode21
Copy link

awacode21 commented Mar 14, 2022

Is there any option to define an order of the head stuff? Or to define specific stuff to be loaded at the end of head?

I have the problem, that i use vueuse/head for my font face definitions in style tag and also for preloading of the fonts.
But the font faces get loaded before the fonts. That results in following warning

Bildschirmfoto 2022-03-14 um 10 22 28

Because there is no font face definition AFTER the font loading.
It can be fixed when the style tag with font face definition is at the very end of head. But i don't find a configuration how to achieve this with vueuse/head.

I think there are use cases where the order in the head can be important.

Note: using vueuse/head with SSR

@awacode21
Copy link
Author

maybe you can ensure for the ordering in the head that files with preloading come first?

@awacode21
Copy link
Author

awacode21 commented Jul 4, 2022

Any feedback on this? @antfu

@JohnCampionJr
Copy link

@antfu I'm getting bit by this issue too. I am inserting theme CSS files with useHead but they are ending up at the bottom of the head element, so they are overriding things like Tailwind. Need some sort of option to put things at the top of the head in my case.

@antfu
Copy link
Member

antfu commented Sep 3, 2022

PR welcome and I will review.

@harlan-zw
Copy link
Collaborator

See https://github.com/vueuse/head#render-priority

If you're server-side rendering then it should solve it. Feel free to re-open the issue if you need non-SSR support

@awacode21
Copy link
Author

@harlan-zw first... thank you!!! i think i need both, server side and client side support. When i check what's delivered by the server it's looking good, but than on client side it is still the other way round and still with the console warnings.

@harlan-zw harlan-zw reopened this Sep 19, 2022
@harlan-zw
Copy link
Collaborator

Hm okay thanks for the feedback, I'll re-open this

The issue why it's SSR only is that the patching nodes with ordering client side is not possible without doing some re-engineering of how the DOM updates work, I'll see what I can do

@harlan-zw
Copy link
Collaborator

With any of the v1 RC versions, the client side can also be ordered.

Going to close, let me know if you have any issues with it.

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 a pull request may close this issue.

4 participants