lightningcss
lightningcss copied to clipboard
Inconsistent CSS variables rules optimization
Given the following CSS:
.foo {
color: red;
color: var(--my-red);
background-color: blue;
background-color: var(--my-blue);
}
I get this output:
.foo {
color: var(--my-red);
background-color: #00f;
background-color: var(--my-blue);
}
I would also expect only the CSS variables background-color rule version to be kept, like it is the case with color. Is this a bug?
Yeah we could probably make this line conditional depending what other background-related properties have been seen. https://github.com/parcel-bundler/lightningcss/blob/9b3e6f425b1132243930737f306cb864b7b892d0/src/properties/background.rs#L897