Disable jquery.ui.theme.css only for front end? I'm using jquery tabs on my page but they loaded some default styles that I didn't want. Thus I removed them with the following code:

drupal_add_library('system', 'ui.tabs');


function mytheme_css_alter(&amp;$css) {
   // List of disabled drupal default css files.
   $disabled_drupal_css = array(
      // Remove jquery.ui css files.
      'misc/ui/jquery.ui.core.css',
      'misc/ui/jquery.ui.theme.css',
      //  'misc/ui/jquery.ui.tabs.css',
   );

  // Remove drupal default css files.
     foreach ($css as $key =&gt; $item) {
         if (in_array($key, $disabled_drupal_css)) {
            // Remove css and its altered version that can be added by jquery_update.
            unset($css[$css[$key]['data']]);
            unset($css[$key]);
         }
     }
}


This seems to do the trick, but I also noticed that my backend is not loading it's styles properly. I guess some of it uses the jquery.ui styles. 

How can I load these only for the logged in user but not for
I would use user_is_anonymous() function like this:

function yourtheme_css_alter(&amp;$css) { 
  if(user_is_anonymous()) {
    $exclude = array(
      'misc/ui/jquery.ui.core.css' =&gt; FALSE,
      'misc/ui/jquery.ui.theme.css' =&gt; FALSE,
    );
    $css = array_diff_key($css, $exclude);
  }
}