Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Removing or overriding default CSS files

17/04/2025, by Ivan

Sometimes it’s necessary to modify or remove default CSS files like system.css, defaults.css, or system-menus.css. While you could directly edit these files, doing so risks losing your changes during a future Drupal update. To avoid this, it's best to exclude these files from being output by Drupal. If you still need some CSS rules from those files, you can copy them into your theme’s style.css and edit them there. This way, you protect your CSS from being accidentally overwritten.

To do this, create a template.php file in your theme directory (if it doesn’t already exist). Add the following code to that file:

function phptemplate_preprocess_page(&$vars) {
  $css = $vars['css'];
  unset($css['all']['module']['modules/system/system.css']);
  unset($css['all']['module']['modules/system/defaults.css']);
  unset($css['all']['module']['modules/system/system-menus.css']);
  $vars['styles'] = drupal_get_css($css);
}

Now you can copy any needed CSS rules from those files into style.css in your theme and modify them freely.

The same approach applies to the CSS files from the Nice Menus module, which is commonly used to create dropdown menus. It's better to override its styles in your style.css. To exclude the module’s CSS files, add this code to template.php:

function phptemplate_preprocess_page(&$vars) {
  $css = $vars['css'];
  unset($css['all']['module']['modules/system/system.css']);
  unset($css['all']['module']['modules/system/defaults.css']);
  unset($css['all']['module']['modules/system/system-menus.css']);
  unset($css['all']['module']['sites/all/modules/nice_menus/nice_menus.css']);
  unset($css['all']['module']['sites/all/modules/nice_menus/nice_menus_default.css']);
  $vars['styles'] = drupal_get_css($css);
}

Note: The path nice_menus/nice_menus_default.css assumes the Nice Menus module is located in the sites/all/modules/nice_menus folder — without any version number in the folder name.

drupal nice menu