clean-css
clean-css copied to clipboard
"mergeNonAdjacentRules" not works in some cases
Environment
- clean-css version: 5.3.2
- node.js version: v18.12.1
- operating system: Win10
Configuration options
var CleanCSS = require('clean-css');
new CleanCSS({"level": {2: { mergeNonAdjacentRules: true } } })
Input CSS
.selector .title {
border: 0;
}
.wrapper .container {
padding: 0;
}
.other{
border-radius: 1px;
}
.selector .title {
padding: 1px;
}
Actual output CSS
.selector .title {
border: 0;
}
.wrapper .container {
padding: 0;
}
.other{
border-radius: 1px;
}
.selector .title {
padding: 1px;
}
Expected output CSS
.wrapper .container {
padding: 0;
}
.other{
border-radius: 1px;
}
.selector .title {
border: 0;
padding: 1px;
}
If you replace border-radius with any other property, the merge will work as expected.