Replies: 4 comments 1 reply
-
It's a misnomer from Tailwind Play, since it strips |
Beta Was this translation helpful? Give feedback.
-
@wongjn This isn't only related to Tailwind Play, it happens with the When building, tailwindcss v4 does not detect SvelteKit's 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> While this is easily fixable by adding I've also made a minimal repro: https://github.com/DarthGigi/tailwind-v4-app-html-mvce |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What version of Tailwind CSS are you using?
For example: v4.0.4
What build tool (or framework if it abstracts the build tool) are you using?
For example: Vite 6.1.0 with SvelteKit and Svelte 5
What version of Node.js are you using?
For example: v22.9.0
What browser are you using?
For example: Brave, Safari
What operating system are you using?
For example: macOS
Reproduction URL
This code shows
text-orange-600
andtext-red-600
in the html and body tag respectively does not take effect.https://play.tailwindcss.com/kse6I0muoR
Describe your issue
I believe Tailwind classes does not work on the html or body tag despite the documentation saying that is possible.
I discovered this when I upgraded from v3.4.4 to v4.0.3. I was originally using a custom font and has
class="font-xxx"
in thebody
tag ofapp.html
. The font displayed correctly in v4 while in development hot-reload mode, but not when built. Using my browser's dev tool I saw in the built version that the final css class.font-xxx
was no where to be found.Am I missing something stupidly simple? Perhaps the support for html and body tags were dropped in v4?
Beta Was this translation helpful? Give feedback.
All reactions