css / csso

CSS minifier with structural optimizations
https://css.github.io/csso/csso.html
MIT License
3.74k stars 189 forks source link

A bug with restructuring and shorthands #478

Open stoyan opened 4 months ago

stoyan commented 4 months ago
.a {
    background: none;
    background-size: 1;
    b: c;
}

.b {
    background: some;
    background-size: 1;
    b: c;
}

becomes

.a,.b {
    background-size: 1;
    b: c
}

.a {
    background: 0 0
}

.b {
    background: some
}

The problem is background-size is wiped out by the shorthand background that comes after it