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

Flash of style on start up #15

Open
donaldpipowitch opened this issue Mar 2, 2016 · 6 comments
Open

Flash of style on start up #15

donaldpipowitch opened this issue Mar 2, 2016 · 6 comments

Comments

@donaldpipowitch
Copy link

When opening the app the app is initially unstyled, because the styles will be injected asynchronous. It would be nice to get rid of that.

@glenjamin
Copy link
Owner

I'm not aware of a good way to do this.

The production build would use extract text plugin to load styles early, but I don't think there's a way to do this and still have CSS in the bundle hot reloaded

@donaldpipowitch
Copy link
Author

Maybe you could use the extract text plugin for development, too, and handle reloading of CSS just with a classic livereload server.

@glenjamin
Copy link
Owner

That sounds like it could work

@kale1d0code
Copy link

Hi don't know if you guys have come across this?
https://github.com/HumbleSpark/react-ssr-critical-styles
this should sort out above the fold css

@namnm
Copy link

namnm commented Aug 13, 2017

We can achieve this using jsdom-global package. We will add global dom environment into Node. Every time we prepare html to return, we can add the style tags into that html from jsdom-global. I will make some tweaks and see if it works.

@gajus
Copy link

gajus commented Aug 13, 2017

Or you could have a look at https://github.com/gajus/usus.

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

No branches or pull requests

5 participants