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

Homepage has a lot of styles #36

Closed
mxstbr opened this issue May 26, 2017 · 6 comments
Closed

Homepage has a lot of styles #36

mxstbr opened this issue May 26, 2017 · 6 comments
Labels

Comments

@mxstbr
Copy link
Member

mxstbr commented May 26, 2017

For some reason the homepage ships a lot of styles (a few thousand lines) even though it should only serve the ones needed to render the homepage. Something's wrong, /cc @styled-components/core 🤔

Maybe that's due to Next.js and how it renders?

h/t @threepointone @AndrewIngram

@mxstbr mxstbr added the bug label May 26, 2017
@mxstbr
Copy link
Member Author

mxstbr commented May 26, 2017

It has to be due to the fact how Next.js renders, does it render all the pages at once? That would explain why we inject all of the CSS, since that means all components are rendered. /cc @arunoda @rauchg

@kitten
Copy link
Member

kitten commented May 26, 2017

@mxstbr it is because we're not actually wrapping around the app. There's an open issue for this on next.js :)

vercel/next.js#1751

@kitten kitten marked this as a duplicate of #58 Jul 14, 2017
@kitten
Copy link
Member

kitten commented Aug 29, 2017

This is resolved for now as I've added a vendored version of next with the fix mentioned above

Edit: I created an issue to remind myself to get rid of the vendor tarball: #94

@kitten kitten closed this as completed Aug 29, 2017
@threepointone
Copy link

Looks good! I notice styled-components.com has a lot fewer styles now, so that's great. it still appears to be injecting every rule twice though?

@kitten
Copy link
Member

kitten commented Aug 29, 2017

@threepointone Wow! It indeed is. Wtf?

Edit: In this case I shall reopen this issue

@kitten kitten reopened this Aug 29, 2017
@mxstbr
Copy link
Member Author

mxstbr commented Nov 10, 2017

This is fixed, right?

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

No branches or pull requests

4 participants