withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.37k stars 2.46k forks source link

Tailwind styles not being applied to react components #12205

Open vighgiv opened 1 week ago

vighgiv commented 1 week ago

Astro Info

(from stackblitz):
Astro                    v4.16.1
Node                     v18.20.3
System                   Linux (x64)
Package Manager          unknown
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/react

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

Using a Layout inside a Layout causes Tailwind classes to not take effect on React components, if no HTML tag is present.

If you uncomment any of the divs in the stackblitz example the bug is gone.

What's the expected result?

The tailwind classes should take effect without needing to add empty HTML tags.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-yy3eza

Participation

florian-lefebvre commented 16 hours ago

what's weird is that it works if an empty head is added to the base layout, see https://stackblitz.com/edit/github-yy3eza-pevwsu. I think @bluwy may know why