-
-
Notifications
You must be signed in to change notification settings - Fork 319
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
[Bug]: [postcss-merge-rules] Why the code in the example cannot be compressed #1598
Comments
cssnano does not reorder rules. In general, reordering CSS rules could lead to a different result. I don't know how complex the code to determine whether reordering is safe would be. |
For situations where automatic judgment is difficult, an option can be provided to the user. For example, |
What's an example where this custom rule would be useful? If the CSS is written by hand, it would be difficult to be sure it always respects the same structure. If it is generated, why write redundant rules to a file if the programmer already knows how they can be deduplicated. |
It makes sense. 👍 |
Describe the bug
bug demo
Why didn't cssnano merge the class name "a" ?
write
output
But when I replace the writing order, cssnano can successfully merge
wtite
output
Expected behaviour
expect to see
Steps to reproduce
use cssnano playground
bug demo
Version
6.1.2
Preset
default
Environment
Package details
Additional context
No response
The text was updated successfully, but these errors were encountered: