Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.192
diff -u -p -r1.192 bootstrap.inc
--- includes/bootstrap.inc	10 Sep 2007 12:19:11 -0000	1.192
+++ includes/bootstrap.inc	26 Sep 2007 21:05:36 -0000
@@ -996,6 +996,7 @@ function drupal_maintenance_theme() {
   unicode_check();
   drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
   drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module');
   $theme = '';
 
   // Special case registry of theme functions used by the installer
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.688
diff -u -p -r1.688 common.inc
--- includes/common.inc	20 Sep 2007 08:30:34 -0000	1.688
+++ includes/common.inc	26 Sep 2007 21:05:37 -0000
@@ -1557,7 +1557,7 @@ function drupal_add_css($path = NULL, $t

 /**
  * Returns a themed representation of all stylesheets that should be attached to the page.
- * It loads the CSS in order, with 'core' CSS first, then 'module' CSS, then 'theme' CSS files.
+ * It loads the CSS in order, with 'module' CSS first then 'theme' CSS files.
  * This ensures proper cascading of styles for easy overriding in modules and themes.
  *
  * @param $css
@@ -1577,11 +1577,56 @@ function drupal_get_css($css = NULL) {
   $directory = file_directory_path();
   $is_writable = is_dir($directory) && is_writable($directory) && (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC);

+  global $theme_info, $base_theme_info;
+  // Read from theme's .info file.
+  if (isset($theme_info->info['style override path'])) {
+    $style_override_paths[dirname($theme_info->filename)] = $theme_info->info['style override path'];
+  }
+  if (!empty($base_theme_info)) {
+    // Collect all base theme paths and override directories.
+    foreach ($base_theme_info as $base_theme) {
+      if (isset($base_theme->info['style override path'])) {
+        $style_override_paths[dirname($base_theme->filename)] = $base_theme->info['style override path'];
+      }
+    }
+  }
+
   foreach ($css as $media => $types) {
     // If CSS preprocessing is off, we still need to output the styles.
     // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones.
     foreach ($types as $type => $files) {
       foreach ($types[$type] as $file => $preprocess) {
+        // Allow current theme to provide module and base theme overrides.
+        if (isset($style_override_paths)) {
+          // Styles will be rebuilt to maintain original order.
+          unset($types[$type][$file]);
+          // Get the sub-path to the style sheet for modules and themes since it can be installed in multiple locations.
+          // The sub-path starts from either "modules/" or "themes/". For example, if the path to a module style is
+          // "sites/all/modules/foo/bar.css" then "modules/foo/bar.css" will be returned.
+          $old_style_path = strstr($file, $type .'s/');
+          $split_sections = explode('/', $old_style_path);
+          // Loop through override paths for the current theme and sub-themes.
+          foreach ($style_override_paths as $theme_path => $override_path) {
+            // Rebuild the old path by each section and check for the existance of an override.
+            foreach (array_reverse($split_sections) as $section) {
+              $path_style = !isset($path_style) ? $section : "$section/$path_style";
+              if (file_exists($theme_path .'/'. $override_path .'/'. $path_style)) {
+                $overrides[] = $theme_path .'/'. $override_path .'/'. $path_style;
+              }
+            }
+            // If found, Get the most specific style in the array and move on to the next style sheet.
+            if (isset($overrides)) {
+              $file = array_pop($overrides);
+              unset($overrides);
+              continue 1;
+            }
+            // Reset the built path.
+            unset($path_style);
+          }
+          // Rebuild what was unset before with overrides when found.
+          $types[$type][$file] = $preprocess;
+        }
+
         if (!$preprocess || !($is_writable && $preprocess_css)) {
           // If a CSS file is not to be preprocessed and it's a module CSS file, it needs to *always* appear at the *top*,
           // regardless of whether preprocessing is on or off.
Index: modules/system/system-menus-rtl.css
===================================================================
RCS file: modules/system/system-menus-rtl.css
diff -N modules/system/system-menus-rtl.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/system-menus-rtl.css	26 Sep 2007 21:05:37 -0000
@@ -0,0 +1,16 @@
+ul.menu {
+  text-align:right;
+}
+ul.menu li {
+  margin: 0 0.5em 0 0;
+}
+li.expanded {
+  padding: 0.2em 0 0 0.5em;
+}
+li.collapsed {
+  list-style-image: url(../../misc/menu-collapsed-rtl.png);
+  padding: 0.2em 0 0 0.5em;
+}
+li.leaf {
+  padding: 0.2em 0 0 0.5em;
+}
Index: modules/system/system-menus.css
===================================================================
RCS file: modules/system/system-menus.css
diff -N modules/system/system-menus.css
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/system-menus.css	26 Sep 2007 21:05:37 -0000
@@ -0,0 +1,51 @@
+/*
+** Menus
+*/
+ul.menu {
+  list-style: none;
+  border: none;
+  text-align:left; /* LTR */
+}
+ul.menu li {
+  margin: 0 0 0 0.5em; /* LTR */
+}
+li.expanded {
+  list-style-type: circle;
+  list-style-image: url(../../misc/menu-expanded.png);
+  padding: 0.2em 0.5em 0 0; /* LTR */
+  margin: 0;
+}
+li.collapsed {
+  list-style-type: disc;
+  list-style-image: url(../../misc/menu-collapsed.png); /* LTR */
+  padding: 0.2em 0.5em 0 0; /* LTR */
+  margin: 0;
+}
+li.leaf {
+  list-style-type: square;
+  list-style-image: url(../../misc/menu-leaf.png);
+  padding: 0.2em 0.5em 0 0; /* LTR */
+  margin: 0;
+}
+li a.active {
+  color: #000;
+}
+td.menu-disabled {
+  background: #ccc;
+}
+ul.links {
+  margin: 0;
+  padding: 0;
+}
+ul.links.inline {
+  display: inline;
+}
+ul.links li {
+  display: inline;
+  list-style-type: none;
+  padding: 0 0.5em;
+}
+.block ul {
+  margin: 0;
+  padding: 0 0 0.25em 1em; /* LTR */
+}
Index: modules/system/system-rtl.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system-rtl.css,v
retrieving revision 1.3
diff -u -p -r1.3 system-rtl.css
--- modules/system/system-rtl.css	8 Jun 2007 06:04:15 -0000	1.3
+++ modules/system/system-rtl.css	26 Sep 2007 21:05:37 -0000
@@ -21,22 +21,7 @@ dl.multiselect dt, dl.multiselect dd {
   float: right;
   margin: 0 0 0 1em;
 }
-ul.menu {
-  text-align:right;
-}
-ul.menu li {
-  margin: 0 0.5em 0 0;
-}
-li.expanded {
-  padding: 0.2em 0 0 0.5em;
-}
-li.collapsed {
-  list-style-image: url(../../misc/menu-collapsed-rtl.png);
-  padding: 0.2em 0 0 0.5em;
-}
-li.leaf {
-  padding: 0.2em 0 0 0.5em;
-}
+
 .block ul {
   padding: 0 1em 0.25em 0;
 }
Index: modules/system/system.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.css,v
retrieving revision 1.34
diff -u -p -r1.34 system.css
--- modules/system/system.css	6 Sep 2007 13:06:13 -0000	1.34
+++ modules/system/system.css	26 Sep 2007 21:05:37 -0000
@@ -182,58 +182,6 @@ dl.multiselect .form-item {
 }
 
 /*
-** Menus
-*/
-ul.menu {
-  list-style: none;
-  border: none;
-  text-align:left; /* LTR */
-}
-ul.menu li {
-  margin: 0 0 0 0.5em; /* LTR */
-}
-li.expanded {
-  list-style-type: circle;
-  list-style-image: url(../../misc/menu-expanded.png);
-  padding: 0.2em 0.5em 0 0; /* LTR */
-  margin: 0;
-}
-li.collapsed {
-  list-style-type: disc;
-  list-style-image: url(../../misc/menu-collapsed.png); /* LTR */
-  padding: 0.2em 0.5em 0 0; /* LTR */
-  margin: 0;
-}
-li.leaf {
-  list-style-type: square;
-  list-style-image: url(../../misc/menu-leaf.png);
-  padding: 0.2em 0.5em 0 0; /* LTR */
-  margin: 0;
-}
-li a.active {
-  color: #000;
-}
-td.menu-disabled {
-  background: #ccc;
-}
-ul.links {
-  margin: 0;
-  padding: 0;
-}
-ul.links.inline {
-  display: inline;
-}
-ul.links li {
-  display: inline;
-  list-style-type: none;
-  padding: 0 0.5em;
-}
-.block ul {
-  margin: 0;
-  padding: 0 0 0.25em 1em; /* LTR */
-}
-
-/*
 ** Tab navigation
 */
 ul.primary {
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.533
diff -u -p -r1.533 system.module
--- modules/system/system.module	25 Sep 2007 11:49:37 -0000	1.533
+++ modules/system/system.module	26 Sep 2007 21:05:37 -0000
@@ -451,6 +451,7 @@ function system_init() {
   // Add the CSS for this module.
   drupal_add_css(drupal_get_path('module', 'system') .'/defaults.css', 'module');
   drupal_add_css(drupal_get_path('module', 'system') .'/system.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'system') .'/system-menus.css', 'module');
 }
 
 /**
