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

Global style causes unused CSS to be downloaded #535

Open
vostrnad opened this issue Mar 6, 2023 · 0 comments
Open

Global style causes unused CSS to be downloaded #535

vostrnad opened this issue Mar 6, 2023 · 0 comments

Comments

@vostrnad
Copy link

vostrnad commented Mar 6, 2023

SvelteKit downloads an extra CSS file /_app/immutable/assets/Offcanvas.60614438.css when Sveltestrap is used. The entire contents of the file is as follows: (64 bytes including a newline)

.modal-open,.overflow-noscroll{overflow:hidden;padding-right:0}

Digging through the code, this seems to be caused by global styles in Modal and Offcanvas:

// Modal.svelte
<style>
  :global(.modal-open) {
    overflow: hidden;
    padding-right: 0;
  }
</style>

// Offcanvas.svelte
<style>
  :global(.overflow-noscroll) {
    overflow: hidden;
    padding-right: 0px;
  }
</style>

I don't use either of these components in my code but the CSS is still downloaded. I'm not sure whether the components need to be rewritten or it can be fixed some other way.

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