Adding a stylesheet to specific pages is easy: implement hook_preprocess_page()
, call drupal_add_css(...)
and set $vars['styles'] = drupal_get_css()
.
But what is the proper way to remove a stylesheet (or in my case, all "media=screen" stylesheets) for a specific page, without interfering with the caching system ? (e.g. not some regex applied to the output)
You can't just do unset($vars['css']['screen'])
because $vars['styles']
has already been generated at this point and there exists no drupal_remove_css()
function.