* Add failing test for #2823
* cleanup string literals
* use prettier for toMatchCSS diffs
* make sure that importants are applied correctly
Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
* feat: suggest alternate classes if @apply value not found
* fix: remove only from test
* feat: move logic to applyComplexClasses
* fix: remove whitespace
* remove unused files
* did you mean suggestion
When you do something like container.before(someRoot), PostCSS actually *mutates* someRoot, leaving it empty and moving its contents before the container. container.before(arrayOfNodes) on the other hand does no weird mutation.
This PR makes sure generatedUtilities is an array of nodes instead of a PostCSS container to avoid this unexpected mutation. It makes it a bit more work to walk those nodes if they need to be transformed, but I think it's worth the trade-off. Can always write a helper function around that if the boilerplate starts to feel repetitive.
This can result in unexpected behavior, so explicitly erroring is best.
We can of course add support for this later if we see real value in it
and can come up with predictable rules for how it should work.
This is too complex to easily support; better to explicitly error for
now vs. the current behavior which is just silently doing something
other than you probably expect.
This change tells Webpack (for those using it) that the config file
used should be tracked as a dependency and that the CSS should be
re-compiled if that config file changes.
It's careful to make sure the config file is loaded fresh every single
time to avoid weird caching issues.