Replies: 3 comments
-
I also tried the following, still including lightningcss as a css transformer. However, all of Tailwind's color props are still being unintentionally included: @import "tailwindcss/theme" layer(theme); /* Unsure if this is 100% valid */
@import "tailwindcss/utilities" layer(utilities);
@theme {
--color-*: initial;
} Removing lightningcss as a transformer fixes this, but then I can't utilize the benefits of lightningcss. |
Beta Was this translation helpful? Give feedback.
-
BTW, I swapped out lightningcss for postcss instead, and used postcss as a transformer. This seems to work as expected. |
Beta Was this translation helpful? Give feedback.
-
Moving back to lightningcss in place of of postcss… |
Beta Was this translation helpful? Give feedback.
-
Using Tailwind v4 within an Astro project, here's my CSS.
When
lightningcss
is set as thecss.transformer
, it ignores any props set toinitial
. Therefore, based on my example above, all of Tailwind's colors are included, regardless.Now, if I remove
lightningcss
as thecss.transformer
, it works as advertised, and none of Tailwind's colors are included.So, why does the expected behavior not work with lightningcss?
My Astro config, Vite options:
Beta Was this translation helpful? Give feedback.
All reactions