avoid -webkit-border-radius shorthand optimization
See original GitHub issueGiven this input:
.borderTLBR5 { border-radius: 5px 0 5px 0; -moz-border-radius: 5px 0 5px 0; -webkit-border-radius: 5px 0 5px 0; -ms-border-radius: 5px 0 5px 0; -khtml-border-radius: 5px 0 5px 0; }
cleanCSS with no options specified generates:
.borderTLBR5{border-radius:5px 0;-moz-border-radius:5px 0;-webkit-border-radius:5px 0;-ms-border-radius:5px 0 5px 0;-khtml-border-radius:5px 0 5px 0}
While, in Chrome (55.0.2883.95), Opera(42.0.2393.94) and Safari(9.1.2) in a Mac OS X 10.11.6 64-bit
, the syntax:
-webkit-border-radius:5px 0
instead of:
-webkit-border-radius:5px 0 5px 0
breaks the styling and the borders don’t get rendered at all.
The cleanCSS version used is 3.4.23
. I got the same behavior both invoking cleancss from terminal or through gulp
with gulp-cleancss
.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top GitHub Comments
Fixed in 3.4.24 by ignoring any
-webkit-border-radius
optimizations. I realized it’s a more complex case when you factor in longhand properties, like-webkit-border-top-left-radius
…Looks like any
-webkit-border-radius
value which is not:-webkit-border-radius: 5px
-webkit-border-radius: 5px 4px 3px 2px
-webkit-border-radius: 1px / 5px
(both values can be any combination of above)behaves differently than unprefixed version. I have a fix to completely ignore
-webkit-border-radius
but I wonder if it’s worth to apply these special rules and keep optimizing it.