Posted by bflora on August 5, 2010 at 7:57am
I've got a site I'm trying to speed up. One of the obvious tools for this is the "Optimize CSS" option over in the admin performance page. I've used this on other sites without problem. But for some reason, with this site, when I activate it, all my CSS disappears and I'm left without any styles at all on the page.
I've spent a little time trying to troubleshoot but am stumped. What could case the entire CSS to disappear when I activate that option?

Comments
The CSS aggregator is pretty
The CSS aggregator is pretty good but can barf on bad syntax. My first recommendation would be to validate your CSS.
--
Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his
Thanks, that worked great!
Thanks, that worked great!
I want to share one more
I want to share one more cause of CSS optimization break. If the css file uses @import to import files from different locations, css optimizer breaks at adding the correct background url paths. For example I have a style.css in my theme which imports css files exists in the css directory inside the theme directory. In that case it will cause bad syntax and entire layout breaks.
We spent around 8 hours to figure out this.
Issue
Relevant issue: http://drupal.org/node/413296
Even more relevant issue:
Even more relevant issue: http://drupal.org/node/444228
Recently had this one bite me again… The most recent patch in the queue works like a charm, and will hopefully be in a release soon.
The Boise Drupal Guy!
Validating my CSS fixed my
Validating my CSS fixed my CSS breaking when optimized issue.