-
Notifications
You must be signed in to change notification settings - Fork 26
postcss-mixins compatibility problem after update #95
Comments
One additional note that might be helpful - if I disable nesting then the output is the following: body {
color: blue;
background: red;
font-size: 1rem;
@media (min-width: 64em) {
background: green;
}
margin: 0;
} That looks like something postcss-nesting should be able to handle, so it almost seems like the plugins aren't running in the correct order, even though I have mixins running before preset-env. |
@Antonio-Laguna ahh that solved it - thanks! Looked at the changelog after upgrading, but didn't think to re-read the docs. |
@mdmoreau the changelog isn't updated yet. Let me think about this and see what we can do about this. Thanks for testing that! @romainmenke thoughts on this? Kind of think given the ecosystem and how things are normally on PostCSS which can create things that unfurl, we might want to consider enabling this by default unless it's |
@Antonio-Laguna one thing that seems a little strange to me - and maybe I'm misunderstanding how things work - but if mixins is processed first and only has a rule and not a nested selector, shouldn't that still be processed without enabling the new option? In my example it seems like the |
@mdmoreau the thing is that PostCSS8 makes the order of execution no longer important which is interesting and opens lots of possibilities to things to be iteratively taken care of by plugins. However, it leads to interesting unexpected behaviour. Probably nesting is just bailing after completing its thing. |
I think we best tighten up |
@Antonio-Laguna okay cool - appreciate the explanation. Thanks for the quick responses and all the work on the recent updates! |
Agree. Let's discuss a plan of action. I hate how this will impact semver wise. |
I hope this can be done in a patch release. Ideally we would ignore any unexpected css. When such a plugin does it's work and this results in nested css Postcss8 should re-run the visitor for the affected nodes. |
Thought about it some more and I suggest we remove What I was trying to solve was people having issues in newer browsers once nesting exists for a while. Users of postcss-preset-env who split bundles for older vs newer browsers could have CSS that works when processed by this plugin but seems broken in newer browsers. That issue however is maybe best left too linters or dedicated test suites. @Antonio-Laguna If you agree I will prepare a pull request with the needed removals. |
@romainmenke ok, let's do that then! |
Thanks for the recent updates! After getting a project switched over to the latest builds, I'm seeing a new problem while using mixins. It looks like any rules declared in a block after a mixin is called don't get processed. Here's a quick example - can create a demo repo if necessary.
The media block comes through fine, and if I move the mixin call down under a rule, then those above it will be in the build as well. I don't think this is a postcss-mixins plugin problem, as that has always worked correctly with postcss-nested.
Let me know if there's any other info I can provide or if a demo repo would help. Thanks!
The text was updated successfully, but these errors were encountered: