HorusGoul / vite-plugin-stylex

Vite Plugin for StyleX
MIT License
111 stars 11 forks source link

Shadow DOM Suport #27

Open matt-greenfield-15 opened 7 months ago

matt-greenfield-15 commented 7 months ago

Hi,

I have this plugin working just fine when rendering my React app in to the main DOM but styles are not moved to the Shadow DOM when I render my app in a shadow root.

Could that be an option on the plugin maybe? It looks like it might be something here? https://github.com/HorusGoul/vite-plugin-stylex/blob/main/packages/vite-plugin-stylex/src/index.mts#L368

Or would it make more sense to use another vite plugin that takes the outputted CSS and moves it in to the shadow root?

thanks for your help

HorusGoul commented 6 months ago

I'm curious why you need to render the styles within a shadow root. Styles generated by StyleX are atomic and shouldn't need isolation :thinking: