bitovi / react-to-web-component

Convert react components to native Web Components. Works with Preact too!
https://www.bitovi.com/open-source/react-to-web-component
MIT License
679 stars 41 forks source link

tailwind is not working with slots & shadow true #191

Open praveens96 opened 1 month ago

praveens96 commented 1 month ago

I am trying to use tailwind css with my react components and want to convert them to web components for my library.

The issue is, when i want the children in react to work, i need to set the shadow: "open" while generating web component. But, if i set that, tailwind styles are not working.

If i remove shadow: "open" , tailwind styles do work but slots i.e. children are not being shown.

can you help here?

tema3210 commented 1 week ago

the shadow tree get's its own CSS scope, so you just don't have your styles there, so if you want your css you cannot use shadow DOM, can you?