Here http://drupal.org/project/conditional_styles is written:
For example, if you are re-generating the $styles variable in your theme's preprocess_page function by calling $vars['styles'] = drupal_get_css() (old versions of the Zen theme did that), you will either need to stop doing that (adding stylesheets with drupal_add_css in your template.php is bad for performance anyway) or, after you are done screwing with $var['styles'], you can $var['styles'] .= $var['conditional_styles']; to add them back in.
What is right way to add own (color) CSS to some custom pages?
Otherwise then edit template.php and add CSS via drupal_add_css / drupal_get_css?
Comments
Comment #1
JohnAlbinWhen you have CSS aggregation turned on (and you should), Drupal has to combine all the stylesheets together and save it in a new file.
But when you conditionally include an additional stylesheet via drupal_add_css(), you force Drupal to rebuild the aggregated stylesheet for that page. Which is 1.) a significant performance hit for Drupal and, worse, 2.) a big performance hit for your website’s users because they have to download a new really large aggregated stylesheet. :-p
So, the way to avoid that is to:
So now the aggregated stylesheet remains the same on each page request, but the styles that get applied depend on the body classes.
Comment #2
mattez CreditAttribution: mattez commentedJohnAlbin THANX A LOT!
That's what I call right USEFUL clever answer post!
great :)
(more stuff like this here :)