If I want to override the system css in my theme the LESS process breaks the hinting. For example if I put system.menus.css in my theme, Drupal will start using it from my theme instead of from the System module. If in my theme I add the LESS extension on to the system.menu.css file Drupal stops picking up the override and the original system.menus.css file is included as well as my LESS processed version.

Is there a way we can fix that?

Comments

bensnyder’s picture

This isn't a fix - rather a workaround. For the time being, you can add this to your template.php.

I propose that we come up with a fix for this module though so it will honor the override and we don't have to be redundant in template.php.

/**
 * Implements hook_css_alter().
 * @TODO: Once http://drupal.org/node/901062 is resolved, determine whether
 * this can be implemented in the .info file instead.
 *
 * Omitted:
 * - color.css
 * - contextual.css
 * - dashboard.css
 * - field_ui.css
 * - image.css
 * - locale.css
 * - shortcut.css
 * - simpletest.css
 * - toolbar.css
 */
function [themeName]_css_alter(&$css) {
  $exclude = array(
    'misc/vertical-tabs.css' => FALSE,
    'modules/aggregator/aggregator.css' => FALSE,
    'modules/block/block.css' => FALSE,
    'modules/book/book.css' => FALSE,
    'modules/comment/comment.css' => FALSE,
    'modules/dblog/dblog.css' => FALSE,
    'modules/file/file.css' => FALSE,
    'modules/filter/filter.css' => FALSE,
    'modules/forum/forum.css' => FALSE,
    'modules/help/help.css' => FALSE,
    'modules/menu/menu.css' => FALSE,
    'modules/node/node.css' => FALSE,
    'modules/openid/openid.css' => FALSE,
    'modules/poll/poll.css' => FALSE,
    'modules/profile/profile.css' => FALSE,
    'modules/search/search.css' => FALSE,
    'modules/statistics/statistics.css' => FALSE,
    'modules/syslog/syslog.css' => FALSE,
    'modules/system/admin.css' => FALSE,
    'modules/system/maintenance.css' => FALSE,
    'modules/system/system.css' => FALSE,
    'modules/system/system.admin.css' => FALSE,
    'modules/system/system.base.css' => FALSE,
    'modules/system/system.maintenance.css' => FALSE,
    'modules/system/system.menus.css' => FALSE,
    'modules/system/system.messages.css' => FALSE,
    'modules/system/system.theme.css' => FALSE,
    'modules/taxonomy/taxonomy.css' => FALSE,
    'modules/tracker/tracker.css' => FALSE,
    'modules/update/update.css' => FALSE,
    'modules/user/user.css' => FALSE
  );
  $css = array_diff_key($css, $exclude);
}
corey.aufang’s picture

Since #901062: Regression: Themes can no longer remove stylesheets by overriding them in .info files is fixed I think what you could do is like this:

stylesheets[all][] = system.admin.css
stylesheets[all][] = system.admin.css.less

Base on http://drupal.org/node/263967 Drupal should not find the system.admin.css in your theme so it will prevent the loading of the core/base file.

It will find system.admin.css.less which will then be processed like normal.

corey.aufang’s picture

Component: Code » Documentation
Category: feature » task

I believe the solution that I provided in #2 is the best for this situation.

I'm changing this to a documentation task so that I remember to add this to the documentation page when it is created.