Skip to content
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

Glamor server side styles are not loaded #570

Closed
jfrolich opened this issue Nov 24, 2016 · 4 comments
Closed

Glamor server side styles are not loaded #570

jfrolich opened this issue Nov 24, 2016 · 4 comments

Comments

@jfrolich
Copy link
Contributor

When server rendering. Glamor styles seem not to be injected in the dom. Glamor has a section for server side rendering at https://github.com/threepointone/glamor/blob/master/docs/server.md.

However I cannot find how to apply this to gatsby, because it seems to use webpack for generating a static html file.

@KyleAMathews
Copy link
Contributor

So Glamor server rendering is a bit tricky as you need to wrap the React rendering inside Glamor's function renderStatic. In Gatsby 0.x there's no way to do this (without forking Gatsby). In Gatsby 1, I've added an API for taking control of server rendering. If you really need Glamor for 0.x I could help you backport the changes to 0.x (it'd work in a similar way) otherwise Glamor isn't your best choice for styling until Gatsby 1 is out.

@jfrolich
Copy link
Contributor Author

Awesome, can I already beta test Gatsby 1?

@jfrolich
Copy link
Contributor Author

👍 I forked the beta home page, to transition my site to 1.0. Works great, using the css attributes and that is solving my problem :)

@KyleAMathews
Copy link
Contributor

@jfrolich that'll work then :-) just be aware there's some major-ish changes still coming to 1.0 so upgrades might be a bit rough but you should be able to follow along via the CHANGELOG + seeing what I do to update the beta home page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants