Skip to content

[v4] Tailwind CSS does not include SvelteKit's src/app.html file when building #16646

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

Closed
DarthGigi opened this issue Feb 18, 2025 · 1 comment · Fixed by #16631
Closed

[v4] Tailwind CSS does not include SvelteKit's src/app.html file when building #16646

DarthGigi opened this issue Feb 18, 2025 · 1 comment · Fixed by #16631
Labels

Comments

@DarthGigi
Copy link

What version of Tailwind CSS are you using?

For example: v4.0.7

What build tool (or framework if it abstracts the build tool) are you using?

SvelteKit 2.17.2

What version of Node.js are you using?

v22.14.0

What browser are you using?

Chrome

What operating system are you using?

macOS

Reproduction URL

https://github.com/DarthGigi/tailwind-v4-app-html-mvce

Describe your issue

When building, Tailwind CSS v4 does not detect SvelteKit's src/app.html file:

app.html
<!doctype html>
<html lang="en" class="bg-black">
  <head>
    <meta charset="utf-8" />
    <link rel="icon" href="%sveltekit.assets%/favicon.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    %sveltekit.head%
  </head>
  <body data-sveltekit-preload-data="hover" class="bg-red-500">
    <div style="display: contents">%sveltekit.body%</div>
  </body>
</html>
Dev server

ScreenShot 2025-02-09 at 12 43 AM

After build

ScreenShot 2025-02-09 at 12 44 AM

While this is easily fixable by adding @source "app.html"; to your css file where tailwind is being loaded (in this case, src/app.css), I feel like tailwind should automatically include it when building like it does in the dev server.

I've also made a minimal repro: https://github.com/DarthGigi/tailwind-v4-app-html-mvce

Originally posted by @DarthGigi in #16339 (comment)

@philipp-spiess
Copy link
Member

Hey! We have just landed some changes to the Vite plugin that I validated against your repro and it also fixes your issues. The changes will be out in the next patch release (hopefully today). Thanks for the bug report!

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

Successfully merging a pull request may close this issue.

2 participants