Feb 2, 2010 0
YUI CSS Compressor IE problem
I am using the YUI JavaScript / CSS compressor from yahoo to compress our JS & CSS.
While using it I encountered a rather strange problem, the compressed CSS was working fine in Firefox but not in IE. Upon investigating it came down to a peculiar problem.
One of our CSS has a CSS rule like.,
{ height: expression( this.scrollHeight > 96? "96px" : "auto" );}
After running thru the YUI compressor it becomes.,
{height:expression(this.scrollHeight>96? "96px":"auto");}
The above CSS works fine in FF but not in IE (tested in IE8 & IE7)
when I change the above CSS as given below it works fine. Notice the space before and after the > symbol
{height:expression(this.scrollHeight > 96? "96px":"auto");}
For some strange reason after giving those spaces every thing was fine with IE.,
Any Idea whats going on here ? Bug in IE, YUI or the CSS ?
anyway, I just ran a `sed` replace command on the CSS folder to fix it now. Any other elegant fix are welcome.
find . -name "*.css" -print | xargs sed -i 's/>/ > /g'