-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rules get applied every time a new file is processed #31
Comments
Also having this issue. When using Gulp to process several CSS files (after all other processing), the media query extraction is compounding into the subsequent files - like a buffer isn't being cleared after each file has finished being processed. @hamsterkacke my work around was to make a series gulp task (rather than async) for processing the files entirely separately.
Slower processing, but gets the extraction working! |
Hey folks, sorry for the late response I've tried to understand your problem - however I'm afraid I'm unable to reproduce what you described. I modified it to process more than one CSS file and the result remains the same, meaning it's working as expected without mixing up different files. This is how my files looked: // src/one.css
.one { display: none; }
@media screen and (min-width: 1024px) {
.one { display: block; }
}
// src/two.css
.two { display: none; }
@media screen and (min-width: 1024px) {
.two { display: block; }
} Afterwards it emits four files to the Therefore I'm afraid I cannot do anything as it's looking good for me. |
Hello @SassNinja, I think i have the same issue. If you look at your file @media screen and (min-width: 1024px) {
.one { display: block; }
.two { display: block; }
} But it should be @media screen and (min-width: 1024px) {
.two { display: block; }
} |
Hey!
I have a simple gulp process:
`gulp.task('css', () => {
});`
The CSS is already process from sass to css in a step before. So i have various css files in my dist/components folder.
No i want to run extractMediaQuery on it. This works.
BUT there is a major drawback:
The first file, that has extractable stuff in it, gets extracted fine. But on the next file, that has some media queries, the rules from the first extraction are applied again. And so on and so on.
So my first media css file is 318byte. The second one then too, even if the main css file doesn't have media queries. Next one is content + 318byte and so on and so on,
Not sure what i am doing wrong. Why is postcss applying the same stuff over and over again till the last file?
Here are as an example the first process file and the last process file.
@media screen and (min-width:768px){.badge .rating{padding:14px 0}} @media screen and (min-width:768px){.badge .text .image img{width:23px}} @media screen and (min-width:768px){.badge .text .rating-in-words .big{font-size:18px}} @media screen and (min-width:768px){.badge .text .rating-in-words .small{font-size:12px}}
@media screen and (min-width:768px){.badge .rating{padding:14px 0}} @media screen and (min-width:768px){.badge .text .image img{width:23px}} @media screen and (min-width:768px){.badge .text .rating-in-words .big{font-size:18px}} @media screen and (min-width:768px){.badge .text .rating-in-words .small{font-size:12px}} ......redacted by me.... @media screen and (min-width:768px){.toc{position:-webkit-sticky;position:sticky;top:88px}}
As you can see, the first four lines are reapplied.
Any help on that?
The text was updated successfully, but these errors were encountered: