lightningcss
lightningcss copied to clipboard
[bug]lighting css will shuffle css properties order
The same thing happened to us as well. height:auto was ordered after height:calc(...) after minimization instead of before. (height:auto shouldn't have been there in the first place, but the change was definitely unexpected.)
Here's a minimal example showing the breakage:
import fs from "node:fs";
import { transform } from 'lightningcss';
let style = `
.navigation {
height: auto;
height: calc(100vh - var(--header-height, 0rem));
}
`
let { code, map } = transform({
filename: 'style.css',
code: Buffer.from(style),
minify: true,
sourceMap: true
});
fs.writeFileSync(1, code);
console.log()
See:
$ node minify.mjs
.navigation{height:calc(100vh - var(--header-height,0rem));height:auto}
$
The height:auto now overrides the calc() value instead of being overridden by it.