Based on the source[1] it currently trims:
- '; ' => ';'
- ': ' => ':'
- ' {' => '{'
- '{ ' => '{'
- ', ' => ','
- '} ' => '}'
- ';}' => '}'
That still leaves room for improvement of 3 cases (found out through bug 35492).
- Space before }
> return CSSMin::minify("foo { prop: foo }"); foo{prop:foo }
- Space before :
> return CSSMin::minify("foo { prop : foo; }"); foo{prop :foo}
- Space before ;
> return CSSMin::minify("foo { prop: foo ; }"); foo{prop:foo }
- Space before ,
> return CSSMin::minify("foo { prop: foo , bar ; }"); foo{prop:foo ,bar }
Especially the latter two (space before comma or semi-colon) are a fairly common programming style by the "space-extremists".
foo { prop: voo( .. ) , voo( .. ) ; prop: foo ; }
I'm not going to be bold on this one because I haven't checked whether there are any side-effects to these 4 changes, but they seem easy gains :)
Version: 1.17.x
Severity: enhancement