Created
September 10, 2014 08:47
-
-
Save ismailmechbal/1bc8204ef8861a77bedd to your computer and use it in GitHub Desktop.
Drupal - Theming - Remove unnecessary CSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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