-
Notifications
You must be signed in to change notification settings - Fork 12
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
Each at-rule overwrites the previous pointing to the same output file (Webpack 4) #47
Comments
Thanks for the bug report, and repo with the replication. It does sound like there's a bug here. I'll take a look as soon as I can; PRs welcome, in the meantime. Cheers. |
HI! I just ran into a similar issue with my setup. I'm using Gulp5 streams process sass to css. I have different scss Essentially I get something that looks like this: ...
top: 13%;
left: 15%;
}2.185em;
font-weight: var(--fw-normal);
line-height: 1em;
.... As you can see, the actual selector is missing. However, there are about two other selectors sets with rules that should have been included. Here is what was in the 2nd scss file that was missed: main.landing-page {
width: 1080px;
margin: 0 auto;
font-size: 15px;
.font-light {
font-size: 2em;
text-align: center;
font-weight: var(--fw-light);
line-height: 1em;
margin-bottom: 32px;
}
.font-reg {
font-size: /* 2.185em (this bit was included in output) */ You can see where the parent selector had it's last rule as The final output should have looked like this: ...
top: 13%;
left: 15%;
}
/** START MISSING **/
main.landing-page {
width: 1080px;
margin: 0 auto;
font-size: 15px;
}
main.landing-page .font-light {
font-size: 2.00em;
text-align: center;
font-weight: var(--fw-light);
line-height: 1em;
margin-bottom: 32px;
}
main.landing-page .font-reg {
font-size: 2.185em;
font-weight: var(--fw-normal);
line-height: 1em;
letter-spacing: -0.03em;
}
main.landing-page .font-bold {
font-size: /** END MISSING **/ 2.185em;
font-weight: var(--fw-normal);
line-height: 1em;
.... I see there is PR that might fix this issue, however, that PR is very old and it very behind the main code base. The PR was also never merged. So is this a known issue that is not planned for resolution? Or was this supposed to be fixed via other means and I just found out that it's not fully resolved? |
Hello, I guess this could be related to #27.
I am using postcss-critical-css with Webpack 4 (Windows 10) and I am facing the following issue: when importing in the same JS entrypoint several scss partials containing critical at-rules pointing to the same output file, seems like the generated css carries just the contents from one of the sources (usually the one from the last saved source file). Each at-rule overwrites the previous. Sometimes partial overwrites could happen as well, generating syntax errors in the output.
This happens for static scss imports and for dynamic imports of JS files carrying scss imports, as well.
See this repo for further explanation.
Thanks
The text was updated successfully, but these errors were encountered: