Closed jkphl closed 7 years ago
Hmm, yeah. While working on https://github.com/zgreen/postcss-critical-css/issues/11 I think I may have found the cause of this; I'll try and roll a fix for this into that work. Thanks for the report.
I wish I could help you with fixing this but unfortunately I won't be available for the next 2 weeks. We're about launching a project where we'd need this, so the sooner there's a fix the better. Thank you! :)
@jkphl I've got a bit more work to do on it (mostly clean up) but #13 should address this issue (the test passes, currently). I'm going to try and merge it in the next day or two.
Sounds great, @zgreen, thanks! Very much looking forward to the next release!
When using
critical-selector
inside a@media
rule, the complete rule content will be seen as critical. Based on yourexample.css
:I'd expect only the
.foo
selector to be considered critical, resulting inHowever, the whole stylesheet is copied to
critical.css
.