Skip to content

Styles accumelating once your server is running for long #7

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

Open
0xHexE opened this issue Jun 15, 2022 · 0 comments
Open

Styles accumelating once your server is running for long #7

0xHexE opened this issue Jun 15, 2022 · 0 comments

Comments

@0xHexE
Copy link

0xHexE commented Jun 15, 2022

Hi,

I found out that the styletron config which is in the repo has one small issue.

const styletron =
      typeof window === 'undefined'
        ? new Server({
            prefix: '_',
          })
        : new Client({
            hydrate: getHydrateClass(),
            prefix: '_',
          });

This code keeps the same instance on the server. So all the CSS which your whole website generates will contain in all your pages.

And the size of CSS starts increasing if you have something like backgroundImage. In this case, the website size will reach MB.

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

No branches or pull requests

1 participant