-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Unused Layouts' styles are being imported in Dev Mode #7097
Comments
Hi, can you provide the repro with stackblitz or a github repo? Codesandbox shows "task killed" for me and doesn't allow users to download the project :( |
@bluwy Hey there, here's the github repo: |
Just want to bump this issue. Unsure where this lies in priority, but it has made development a nightmare. There are cases when the "styling" works in development because some unrelated styles are bleeding into each other but when deployed with production build, things will fail because those styles aren't actually there. |
This one is pretty interesting. It combines a few things to make it occur. Essentially this happens:
@bluwy Curious what you think about this one. Is there something other than importedModules that we should be looking at? Is there a way to filter out the imports added via addWatchFile? |
I think we need to check the child module's |
PR up. |
What version of
astro
are you using?2.4.5
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome, Safari
Describe the Bug
In an Astro project containing multiple Layouts, the global styles would bleed into each other even though a Page might only be using just one layout at a time. Because of the conflicts of CSS that happens only in Dev, this makes working with Layouts extremely difficult on Astro.
Steps to reproduce:
<style is:global />
tag. In my example, I had the following style tagPage1
) that imports the Layout we just defined.Page2
) that's just a traditional HTML page with a<main>
npm run dev
<main>
element will have the background color defined in the Layout, even though it isn't using or importing it.Thanks again to the Astro team.
Link to Minimal Reproducible Example
https://github.com/LefanTan/astro-unused-layout
Participation
The text was updated successfully, but these errors were encountered: