Skip to content

Tailwind v4 JIT Fails to Generate Standard Spacing Utilities (e.g. .mb-4, .mt-2) Even When Present in Content #18490

Answered by wongjn
mdbrennan asked this question in Help
Discussion options

You must be logged in to vote

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:

 @import "tailwindcss/preflight";
+
+@theme {
+  --spacing: 0.25rem;
+}
+
 @tailwind utilities;

Or import Tailwind default theme tokens:

+@import "tailwindcss/theme.css";
 @import "tailwindcss/preflight";
 @tailwind utilities;

https://play.tailwindcss.com/5kBiPaBjOy?file=css

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mdbrennan
Comment options

Answer selected by mdbrennan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants