replace(/\s+/g, ' ') // multiple whitespace
replace(/ !important/g, '!important') // whitespace before !important
replace(/[ ]?,[ ]?/g, ',') // space with a comma
- replace(/progid:[^(]+\(([^\)]+)/, function(match, contents) { // restore spaces inside IE filters (IE 7 issue)
+ replace(/progid:[^(]+\(([^\)]+)/g, function(match, contents) { // restore spaces inside IE filters (IE 7 issue)
return match.replace(/,/g, ', ');
})
replace(/ ([+~>]) /g, '$1') // replace spaces around selectors
else if (weight == 'bold') return 'font-weight:700';
else return match;
})
- replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)/g, function(match, contents) { // IE shorter filters
- return contents.toLowerCase();
+ replace(/progid:DXImageTransform\.Microsoft\.(Alpha|Chroma)(\([^\)]+\))([;}'"])/g, function(match, filter, args, suffix) { // IE shorter filters but only if single (IE 7 issue)
+ return filter.toLowerCase() + args + suffix;
})
replace(/(\s|:)0(px|em|ex|cm|mm|in|pt|pc|%)/g, '$1' + '0') // zero + unit to zero
replace(/(border|border-top|border-right|border-bottom|border-left|outline|background):none/g, '$1:0') // none to 0
"a{filter:alpha(Opacity=80);-ms-filter:'alpha(Opacity=50)'}"
],
'short chroma': [
- 'progid:DXImageTransform.Microsoft.Chroma(color=#919191)', 'chroma(color=#919191)'
+ 'a{filter:progid:DXImageTransform.Microsoft.Chroma(color=#919191)}', 'a{filter:chroma(color=#919191)}'
],
'matrix filter spaces': [
- "progid:DXImageTransform.Microsoft.Matrix(M11=0.984, M22=0.984, M12=0.17, M21=-0.17, SizingMethod='auto expand')",
- "progid:DXImageTransform.Microsoft.Matrix(M11=.984, M22=.984, M12=.17, M21=-.17, SizingMethod='auto expand')"
+ "a{filter:progid:DXImageTransform.Microsoft.Matrix(M11=0.984, M22=0.984, M12=0.17, M21=-0.17, SizingMethod='auto expand')",
+ "a{filter:progid:DXImageTransform.Microsoft.Matrix(M11=.984, M22=.984, M12=.17, M21=-.17, SizingMethod='auto expand')"
+ ],
+ 'multiple filters (IE7 issue)': [
+ "a{filter:progid:DXImageTransform.Microsoft.Chroma(color=#919191) progid:DXImageTransform.Microsoft.Matrix(M11=0.984, M22=0.984, M12=0.17, M21=-0.17, SizingMethod='auto expand')}",
+ "a{filter:progid:DXImageTransform.Microsoft.Chroma(color=#919191) progid:DXImageTransform.Microsoft.Matrix(M11=.984, M22=.984, M12=.17, M21=-.17, SizingMethod='auto expand')}"
]
}),
'charsets': cssContext({