--- common.inc.orig	2008-09-12 17:03:36.000000000 +0200
+++ common.inc	2008-09-12 16:59:27.000000000 +0200
@@ -1542,12 +1542,21 @@ function drupal_build_css_cache($types, 
     $data = preg_replace($regexp, '', $data);
     $data = implode('', $matches[0]) . $data;
 
+    if(file_exists(getcwd() . '/csstidy/class.csstidy.php')) {
+	include_once(getcwd() . '/csstidy/class.csstidy.php');
+	$css = new csstidy();
+	#$css->set_cfg('remove_last_;',TRUE);
+	#$css->load_template('low_compression');
+	$css->parse($data);
+	$data = $css->print->plain();
+    }
+
     // Perform some safe CSS optimizations.
-    $data = preg_replace('<
-      \s*([@{}:;,]|\)\s|\s\()\s* |  # Remove whitespace around separators, but keep space around parentheses.
-      /\*([^*\\\\]|\*(?!/))+\*/ |   # Remove comments that are not CSS hacks.
-      [\n\r]                        # Remove line breaks.
-      >x', '\1', $data);
+#    $data = preg_replace('<
+#      \s*([@{}:;,]|\)\s|\s\()\s* |  # Remove whitespace around separators, but keep space around parentheses.
+#      /\*([^*\\\\]|\*(?!/))+\*/ |   # Remove comments that are not CSS hacks.
+#      [\n\r]                        # Remove line breaks.
+#      >x', '\1', $data);
 
     // Create the CSS file.
     file_save_data($data, $csspath .'/'. $filename, FILE_EXISTS_REPLACE);
