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

UnoCSS does not scan app.html in SvelteKit project #1774

Closed
AlistairKeiller opened this issue Oct 19, 2022 · 3 comments
Closed

UnoCSS does not scan app.html in SvelteKit project #1774

AlistairKeiller opened this issue Oct 19, 2022 · 3 comments
Labels

Comments

@AlistairKeiller
Copy link

Minimal reproducible example: https://stackblitz.com/edit/sveltejs-kit-template-default-pp7q8l?file=src/routes/+page.svelte

This works in TailwindCSS. Am I missing something from the documentation?

@AlistairKeiller AlistairKeiller changed the title UnoCSS does not scan index.html in SvelteKit project UnoCSS does not scan app.html in SvelteKit project Oct 19, 2022
@jacob-8
Copy link
Contributor

jacob-8 commented Oct 23, 2022

This works in TailwindCSS. Am I missing something from the documentation?

Adding a class to the index.html file of the vite-svelte example works just fine. It is just SvelteKit where it doesn't work properly. SvelteKit's app.html file is never passed to the transformIndexHtml hook in the global plugin. I'm interested in the solution here also so will try to compare to find the difference between the regular vite-svelte-plugin and the sveltekit plugin.

@stale
Copy link

stale bot commented Dec 22, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Dec 22, 2022
@sibbng
Copy link
Member

sibbng commented Dec 23, 2022

We added extraContent option in #1963 and it's released as part of v0.48

You can add that in your config and classes in app.html will be extracted. But transformers will not be applied to those files.

extraContent: {
  filesystem: ['src/app.html']
},

@sibbng sibbng closed this as completed Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants