Customise target node that styles are injected into #395
Replies: 2 comments 3 replies
-
Hey there 👋 I think this injection feature might be in goober territory - twin just replaces the tailwind styles with css objects and then passes them over to Goober. |
Beta Was this translation helpful? Give feedback.
-
I am having the same problem using parcel + react + emotion. I use react-shadow to prevent leaking styles out of an embeddable widget. Unfortunately, twin.macro only works without shadow DOM because the GlobalStyles are injected into the head. I just made a fork of the react-emotion example and added react-shadow to show that the styles won't work. Would it be possible to place the styles at the exact position the GlobalStyles component is added? Or is there another way to inject the styles locally? |
Beta Was this translation helpful? Give feedback.
-
Hello!
I was wondering if it's possible to change the node that styles are injected into?
I'm coding an embeddable widget, and I'd like to encapsulate styles using Shadow DOM.
I can do everything I want with Preact (
preact-custom-element
), but using Twin the styles are still injected into the document head of the web page.I'd like to specify the node so that I can give my custom (shadow dom) element.
Is this possible? If not, how easy/difficult would this be to implement?
I'm using Goober with Twin (styled components and GlobalStyles) and I see it's possible to do this with Goober – Just wondering if there's a specific way to do this with Twin and Goober though.
Beta Was this translation helpful? Give feedback.
All reactions