in Web & Tech

Remove unwanted CSS from a library out of Drupal 7

Libraries that get implemented using the Libraries module sometime bring their own stylesheets which you might not want at all. Instead of overriding each selector you can unset the entire stylesheet as follows:

function mytheme_css_alter(&$css) { 
    unset($css[libraries_get_path('flexslider') . '/flexslider.css']); 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)