I´m not sure if this is the (only) reason why it wasn´t working on my site, but this is how i got it work, in case it helps anyone.
I was adding some CSS in my preprocess_page such as:
drupal_add_css(path_to_theme() . '/css/mycss.css', "theme");
$vars['styles'] = drupal_get_css();
So my guess is the styles were being defined after the module has run, thus "overwriting" it. I added an addictional call and it´s working so:
//in phptemplate_preprocess_page(&$vars, $hook)
drupal_add_css(path_to_theme() . '/css/mycss.css', "theme");
$vars['styles'] = drupal_get_css();
if (module_exists('unlimited_css')) {
unlimited_css_preprocess_page($vars);
}
My guess is the module needs to be after any operations on $vars['styles']... Am I right?.
Comments
Comment #1
donquixote CreditAttribution: donquixote commentedDid you try the same without this module?
I think hook_preprocess_page() is always too late for drupal_add_css(), no matter if you use unlimited_css or not.
You should rather use your theme's *.info file, or in case of modules, a hook that is run before preprocess_page().
See
#891832: Stylesheet handler to replace drupal_add_css() and the stylesheets array in page.tpl.php.
Comment #2
lucascaro CreditAttribution: lucascaro commentedThe same here. If you need to add styles in your theme's preprocess page (when it's a style sheet you need in only one page, for example), you need to get the styles again using drupal_get_css(). Doing this will undo the changes from this module, unless we call the preprocess function again..
Comment #3
donquixote CreditAttribution: donquixote commentedThere are other ways to do that.
One is using pageapi module, and implement hook_pageapi() in your theme.
See
http://drupalcode.org/project/pageapi.git/blob/1efa31e535d2aa225e8b48132...
Comment #4
lucascaro CreditAttribution: lucascaro commentedgreat!
Just in case someone doesn't know what hook_pageapi is, it's provided by a contrib module created by @donquixote at http://drupal.org/project/pageapi
thanks!