From ce2bb79360be126714163427f07ef86f55b1c7d6 Sun, 11 Dec 2011 21:30:35 +0100
From: Bram Goffings <bramgoffings@gmail.com>
Date: Sun, 11 Dec 2011 21:30:27 +0100
Subject: [PATCH] node css

diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css
new file mode 100644
index 0000000..0e1e9fa
--- /dev/null
+++ b/core/modules/node/node.admin.css
@@ -0,0 +1,12 @@
+
+/**
+ * @file
+ * Styles for administration pages.
+ */
+
+/**
+ * Revisions overview screen.
+ */
+.revision-current {
+  background: #FFC;
+}
diff --git a/core/modules/node/node.css b/core/modules/node/node.css
deleted file mode 100644
index 07540fa..0000000
--- a/core/modules/node/node.css
+++ /dev/null
@@ -1,10 +0,0 @@
-
-.node-unpublished {
-  background-color: #fff4f4;
-}
-.preview .node {
-  background-color: #ffffea;
-}
-td.revision-current {
-  background: #ffc;
-}
diff --git a/core/modules/node/node.info b/core/modules/node/node.info
index 2e410ed..ff6f13c 100644
--- a/core/modules/node/node.info
+++ b/core/modules/node/node.info
@@ -8,4 +8,3 @@
 required = TRUE
 dependencies[] = entity
 configure = admin/structure/types
-stylesheets[all][] = node.css
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 7c25666..db88d31 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1536,13 +1536,13 @@
     $variables['classes_array'][] = 'node-sticky';
   }
   if (!$variables['status']) {
-    $variables['classes_array'][] = 'node-unpublished';
+    $variables['classes_array'][] = 'unpublished';
   }
   if ($variables['teaser']) {
     $variables['classes_array'][] = 'node-teaser';
   }
   if (isset($variables['preview'])) {
-    $variables['classes_array'][] = 'node-preview';
+    $variables['classes_array'][] = 'preview';
   }
 
   // Clean up name so there are no underscores.
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index cd1eb6d..5a250f9 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -432,7 +432,10 @@
 function theme_node_preview($variables) {
   $node = $variables['node'];
 
-  $output = '<div class="preview">';
+  // Add the required css.
+  drupal_add_css(drupal_get_path('module', 'node') . '/node.admin.css');
+
+  $output = '';
 
   $preview_trimmed_version = FALSE;
 
@@ -452,7 +455,6 @@
   else {
     $output .= $full;
   }
-  $output .= "</div>\n";
 
   return $output;
 }
@@ -617,6 +619,9 @@
     '#theme' => 'table',
     '#rows' => $rows,
     '#header' => $header,
+    '#attached' => array (
+      'css' => array(drupal_get_path('module', 'node') . '/node.admin.css'),
+    ),
   );
 
   return $build;
diff --git a/core/modules/node/node.tpl.php b/core/modules/node/node.tpl.php
index adb9aa2..79c2df5 100644
--- a/core/modules/node/node.tpl.php
+++ b/core/modules/node/node.tpl.php
@@ -27,12 +27,12 @@
  *     "Article" it would result in "node-article". Note that the machine
  *     name will often be in a short form of the human readable label.
  *   - node-teaser: Nodes in teaser form.
- *   - node-preview: Nodes in preview mode.
+ *   - preview: Nodes in preview mode.
  *   The following are controlled through the node publishing options.
  *   - node-promoted: Nodes promoted to the front page.
  *   - node-sticky: Nodes ordered above other non-sticky nodes in teaser
  *     listings.
- *   - node-unpublished: Unpublished nodes visible only to administrators.
+ *   - unpublished: Unpublished nodes visible only to administrators.
  * - $title_prefix (array): An array containing additional output populated by
  *   modules, intended to be displayed in front of the main title tag that
  *   appears in the template.
diff --git a/core/modules/simpletest/tests/common.test b/core/modules/simpletest/tests/common.test
index 8936808..9eb5105 100644
--- a/core/modules/simpletest/tests/common.test
+++ b/core/modules/simpletest/tests/common.test
@@ -803,7 +803,7 @@
   function testAddCssFileWithQueryString() {
     $this->drupalGet('common-test/query-string');
     $query_string = variable_get('css_js_query_string', '0');
-    $this->assertRaw(drupal_get_path('module', 'node') . '/node.css?' . $query_string, t('Query string was appended correctly to css.'));
+    $this->assertRaw(drupal_get_path('module', 'node') . '/node.admin.css?' . $query_string, t('Query string was appended correctly to css.'));
     $this->assertRaw(drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&amp;arg2=value2', t('Query string not escaped on a URI.'));
   }
 }
diff --git a/core/modules/simpletest/tests/common_test.module b/core/modules/simpletest/tests/common_test.module
index 1481513..faae551 100644
--- a/core/modules/simpletest/tests/common_test.module
+++ b/core/modules/simpletest/tests/common_test.module
@@ -270,7 +270,7 @@
  */
 function common_test_js_and_css_querystring() {
    drupal_add_js(drupal_get_path('module', 'node') . '/node.js');
-   drupal_add_css(drupal_get_path('module', 'node') . '/node.css');
+   drupal_add_css(drupal_get_path('module', 'node') . '/node.admin.css');
    // A relative URI may have a query string.
    drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2');
    return '';
diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css
index 1993d17..0e19a22 100644
--- a/core/modules/system/system.theme.css
+++ b/core/modules/system/system.theme.css
@@ -38,6 +38,16 @@
 }
 
 /**
+ * Publishing status.
+ */
+.unpublished {
+  background-color: #fff4f4;
+}
+.preview {
+  background-color: #ffffea;
+}
+
+/**
  * Markup generated by theme_tablesort_indicator().
  */
 th.active img {
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index a66b95b..d474730 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -596,16 +596,11 @@
   margin-bottom: 30px;
   padding-bottom: 15px;
 }
-.node-sticky {
+.node-teaser.node-sticky {
   background: #f9f9f9;
   background: rgba(0, 0, 0, 0.024);
   border: 1px solid #d3d7d9;
   padding: 0 15px 15px;
-}
-.node-full {
-  background: none;
-  border: none;
-  padding: 0;
 }
 .node-teaser .content {
   clear: none;
@@ -658,11 +653,11 @@
   color: #68696b;
   font-size: 0.821em;
 }
-.node-unpublished {
+.unpublished {
   margin: -20px -15px 0;
   padding: 20px 15px 0;
 }
-.node-unpublished .comment-text .comment-arrow {
+.unpublished .comment-text .comment-arrow {
   border-left: 1px solid #fff4f4;
   border-right: 1px solid #fff4f4;
 }
diff --git a/core/themes/bartik/templates/node.tpl.php b/core/themes/bartik/templates/node.tpl.php
index 234b899..a70a39b 100644
--- a/core/themes/bartik/templates/node.tpl.php
+++ b/core/themes/bartik/templates/node.tpl.php
@@ -27,12 +27,12 @@
  *     "Article" it would result in "node-article". Note that the machine
  *     name will often be in a short form of the human readable label.
  *   - node-teaser: Nodes in teaser form.
- *   - node-preview: Nodes in preview mode.
+ *   - preview: Nodes in preview mode.
  *   The following are controlled through the node publishing options.
  *   - node-promoted: Nodes promoted to the front page.
  *   - node-sticky: Nodes ordered above other non-sticky nodes in teaser
  *     listings.
- *   - node-unpublished: Unpublished nodes visible only to administrators.
+ *   - unpublished: Unpublished nodes visible only to administrators.
  * - $title_prefix (array): An array containing additional output populated by
  *   modules, intended to be displayed in front of the main title tag that
  *   appears in the template.
