-
Notifications
You must be signed in to change notification settings - Fork 924
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
Get CSS styles working with styled-components #565
Comments
Since we remove the js from the page, the only option you currently have there is to export your CSS onto the page so that the static HTML page can use that CSS. Does styled-components have a CSS export ability so that you can inject that onto the page? |
Thank you for your answer @thoop So, as far as I know, and after searching a bit about it, it seems styled-components doesn't have that possibility: styled-components/styled-components#1018 :( |
I opened a thread asking for help in the styled-components forum -> Get CSS styles working with prerender.io Apparently, there is no solution for this... that's a pity 😔 |
That's unfortunate :( Prerender.io removes the javascript from the page because we don't want the crawlers to try to execute any javascript and accidentally clear out the prerendered content. So the page needs to render properly without javascript being run, hence the need for the exported CSS to be in the HTML. I'm going to close this issue since it would require us leaving all javascript on the page and that's not something we plan on doing currently. If you find a way to export that CSS, please let us know how you do it! |
Hi guys!
I'm running prerender on my server, SSR works very well apart from the styles. I use styled-components in my project and they have this documentation about using SSR.
I've been struggling to implement the solution... but I'm not able to get it working.
Does anybody had got SSR working with prerender and styled-components?
Any help in this matter will be highly appreciated.
Cheers.
The text was updated successfully, but these errors were encountered: