Skip to content

Instantly share code, notes, and snippets.

@ismailmechbal
Created September 10, 2014 08:47
Show Gist options
  • Save ismailmechbal/1bc8204ef8861a77bedd to your computer and use it in GitHub Desktop.
Save ismailmechbal/1bc8204ef8861a77bedd to your computer and use it in GitHub Desktop.
Drupal - Theming - Remove unnecessary CSS
To remove unnecessary css in drupal
add this code to template.php
/**
* Clean system css
*/
function uk_css_alter(&$css) {
foreach ($css as $key => $value) {
if ($value['group'] != CSS_THEME) {
$exclude[$key] = FALSE;
}
}
$css = array_diff_key($css, $exclude);
}
To override system css, add the following code and files to theme.info (the techinique is FOAD)
stylesheets[all][] = css/foad/ctools.css
stylesheets[all][] = css/foad/field.css
stylesheets[all][] = css/foad/node.css
stylesheets[all][] = css/foad/system.messages.css
stylesheets[all][] = css/foad/system.menus.css
stylesheets[all][] = css/foad/user.css
stylesheets[all][] = css/foad/views.css
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment