-
Title:Tailwind v4 JIT Fails to Generate Standard Spacing Utilities (e.g. Summary:In Tailwind CSS v4.1.11, the JIT engine does not generate standard spacing utility classes (like Steps to Reproduce:
What I Expected:All standard spacing utilities used in the content should be generated in the output CSS. What Actually Happens:
Workarounds Tried:
Environment:
Impact:This breaks static site generation workflows and makes it impossible to rely on Tailwind’s default spacing scale for static builds. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The padding and spacing values rely on the @import "tailwindcss/preflight";
+
+@theme {
+ --spacing: 0.25rem;
+}
+
@tailwind utilities; Or import Tailwind default theme tokens: +@import "tailwindcss/theme.css";
@import "tailwindcss/preflight";
@tailwind utilities; |
Beta Was this translation helpful? Give feedback.
The padding and spacing values rely on the
--spacing
theme token. This does not exist with your input CSS. You could add it using@theme
:Or import Tailwind default theme tokens:
+@import "tailwindcss/theme.css"; @import "tailwindcss/preflight"; @tailwind utilities;
https://play.tailwindcss.com/5kBiPaBjOy?file=css