When CSS rule declares the same property twice, earlier declaration with !important modifier and later one without it, CSS minified incorrectly keeps the later one.
Steps to reproduce:
- Create
style.css with following content:
.selector {
padding: 10px !important;
padding: 0;
}
- Run
esbuild --minify style.css
Expected output:
.selector{padding:10px!important}
Actual output:
I acknowledge that original thing is a pretty silly code to write and should probably be caught by a linter. Nevertheless, this introduces a difference between minified and non-minified code.
When CSS rule declares the same property twice, earlier declaration with
!importantmodifier and later one without it, CSS minified incorrectly keeps the later one.Steps to reproduce:
style.csswith following content:esbuild --minify style.cssExpected output:
Actual output:
I acknowledge that original thing is a pretty silly code to write and should probably be caught by a linter. Nevertheless, this introduces a difference between minified and non-minified code.