-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
styled-components: CSS not being applied #29
Comments
Hi René :) It seems the project is missing a build process (i.e. Webpack) that builds the actual assets, in this case transforms the styled-components code to CSS. The JSX adapter renders your components server-side and outputs the resulting HTML. Depending on how the plugin works it might add the CSS inline to the page or extracts it into a separate file. In the latter case you would have to reference the file in the Let me know if you still have trouble getting this to work :) Cheers |
Hey, I was confused because I have a pretty minimalistic setup somewhere else with just browserify+babelify+browsersync where styled-components "just worked" without any additional plugins or such. But it makes sense that if the JSX-Adapter renders server-side it is missing the part to "collect the styles". Thanks for the hint. :) |
Hey Dennis! For completeness sake I wanted to share the solution to have Styled-Components work in the UIEngine:
Thanks for your help! |
Hey René, thanks for sharing this 👍🏻 |
Hi Dennis! :)
Describe the bug
I tried to take UIEngine for a spin with a project from scratch using the jsx-adapter and styled-components.
While the definition of the components works as expected and the styled-components library applies its generated classes to the elements, the actual css seems to get lost somewhere along the way.
To Reproduce
I setup a minimalistic project to reproduce the described behaviour if you take a look at the Heading-component here:
https://github.com/MrAvantiC/uiengine-test
Expected behavior
The code
should result in a red font-color.
The text was updated successfully, but these errors were encountered: