I am trying to unsetting the deafult CSS through a foreach loop, but seems its not working in


here is my code, please have a look.

$arrCSS = drupal_add_css();
          foreach ($arrCSS as $key => $value) {
          $all_css = drupal_add_css();

  • Please stop editing your questions to make them useless. – kiamlaluno Jul 21 '15 at 16:11

CSS should be manipulated using hook_css_alter(), not in an HTML preprocess (where it's too late).

function hook_css_alter(&$css) {
  // Remove defaults.css file.
  unset($css[drupal_get_path('module', 'system') . '/defaults.css']);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.