YSlow rule #8 – Avoid CSS Expressions
So what’s the problem with doing CSS expressions? Let’s look at an example from the YSlow documentation:
background-color: expression( (new Date()).getHours()%2 ? "#B8D4FF" : "#F08A00" );
The example above set the background color to either of two hex values, depending on the current time. The problem here is that the browser executes the code over and over again, each time the user interacts with the page (scroll, click, and even move the mouse). Even though this only affects the performance inside each individual browser, it can result in a slow-performing browser.
I’ve never used CSS expressions myself and won’t recommend anyone to do so. Also, CSS expressions are only supported by Internet Explorer 5 to 7. Microsoft has really done some cool stuff over the years, but this must be one of their greatest screwups.