-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styling with styled-jsx and React renderer #1547
Comments
It's almost certainly because styled-jsx is inserting styles into the head and Skate creates a shadow root. Related issue: vercel/styled-jsx#28. If you're not doing anything super crazy with your styles, you can try using something like https://github.com/treshugart/shadow-css. |
Thanks @treshugart for quick reply. In my case React components need to be shared between React project and web components. React project uses styled-jsx so it would be nice to make SkateJS web components able to use that shared React components with styled-jsx using React renderer. Another thing I was trying to do is to use |
Is there a way for you to share a working example, gist or some code? Happy to take it from there to try and get something working. I'll see if I can ping Zeit to see if they've found an easier solution for this. |
Pinged: vercel/styled-jsx#28 (comment). |
I've created a very simple demo: https://github.com/ussuritiger/skatejs-react-styled-jsx The only difference with real case is that shared components are installed with yarn/npm from GitHub (in this demo shared React component is in Thanks for your time and enthusiasm. Hopefully you have some ideas how to make this combination work. |
Hey @treshugart, did you have a chance to look at the example I’ve provided? |
Hey @ussuritiger. Sorry for the late reply. That link is 404'ing. |
Sorry, please have a look, it is back @treshugart |
@ussuritiger 404 again... |
I am trying to use React renderer with style-jsx but cannot make styling work. Babel and Webpack is properly configured so the build is going well. Markup with styled-jsx unique classes is rendered correctly inside SkateJS custom element however styling itself is missing. Any ideas on why styled-jsx does not work inside custom elements build with SkateJS? Thanks.
The text was updated successfully, but these errors were encountered: