matthiasmullie / minify

CSS & JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.
https://matthiasmullie.github.io/minify/
MIT License
1.96k stars 310 forks source link

Don't transform flex-basis: 0 into flex-basis: 0% #368

Open Golmote opened 3 years ago

Golmote commented 3 years ago

Hello,

When given this code:

.foo {
    flex-basis: 0;
}

or this code:

.foo {
    flex-basis: 0px;
}

the minifier transform the value into 0%:

.foo{flex-basis:0%}

This is an issue because using percentages for flex-basis does not produce the same result.

This issue also happens when using the flex shorthand:

.foo {
    flex: 1 0 0;
}
.bar {
    flex: 1 0 0px;
}

gives

.foo{flex:1 0 0%}.bar{flex:1 0 0%}