-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Bug]: Font not loading in Sveltekit #41
Comments
Hello @Maggi64! Thanks for opening this issue, we will get back to you soon! If you love our work, please consider sponsoring us |
Hello @Maggi64! I've found that I can not inject head tags via the vite plugin (this is related to sveltekit not using So, similarly to astro, we have to manually inject links to the template: <script>
import { links } from 'unplugin-fonts/head'
</script>
<svelte:head>
{#each links as link}
<link {...link?.attrs || {}} />
{/each}
</svelte:head> I can export a simple component like I did for astro here: https://github.com/cssninjaStudio/unplugin-fonts/blob/main/src/astro/component.astro What do you think? |
@stafyniaksacha sounds good! |
Demo URL
https://stackblitz.com/edit/sveltejs-kit-template-default-yh1zpq?file=jsconfig.json
What happened?
Thank you for this cool lib :)
I couldn't get it to work on sveltekit. I think configured everything correctly, but the font still won't load.
Reproduction steps
1. Open Stackblitz 2. npm run dev 3. font isn't loaded/applied
Relevant log output
No response
What browsers are you seeing the problem on?
No response
What is your operating system?
No response
The text was updated successfully, but these errors were encountered: