Posted By

berkes on 09/21/07


Tagged

css drupal stylesheet theme phptemplate SympalTheme Drupal5x themeing defaultcss


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

basicmagic
marcoba
panatlantica


Drupal - Unset (not include) all core stylesheets - Theme variable overrides.


 / Published in: PHP
 

Removes the core, and node styles from the $style variable.

You most morbably already defined phptemplatevariables($hook, $vars), in that case just add the two lines there. sympaltheme.. is the name of the theme where we use this.

  1. function _phptemplate_variables($hook, $vars) {
  2. switch ($hook) {
  3. case 'page':
  4. $vars['css'] = _sympal_theme_unset_css($vars['css']);
  5. $vars['styles'] = drupal_get_css($vars['css']);
  6. break;
  7. }
  8.  
  9. return $vars;
  10. }
  11.  
  12. /**
  13.  * Unset all module and core styles
  14.  **/
  15. function _sympal_theme_unset_css($css) {
  16. if (is_array($css['all']['module'])) {
  17. $css['all']['module'] = array();
  18. }
  19. return $css;
  20. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: STaRDoGG on November 3, 2012

What's the purpose of this? To lighten the overhead a bit when using your own theme style?

You need to login to post a comment.