Issue #1217012 by jyve, aspilicious, brianV, jvc26: Clean up CSS for the Node module

8.0.x
Jennifer Hodgdon 2012-02-29 17:03:30 -08:00
parent 2f96316446
commit d1aee00aaf
12 changed files with 54 additions and 55 deletions

View File

@ -0,0 +1,12 @@
/**
* @file
* Styles for administration pages.
*/
/**
* Revisions overview screen.
*/
.revision-current {
background: #ffc;
}

View File

@ -1,10 +0,0 @@
.node-unpublished {
background-color: #fff4f4;
}
.preview .node {
background-color: #ffffea;
}
td.revision-current {
background: #ffc;
}

View File

@ -7,4 +7,3 @@ files[] = node.module
files[] = node.test files[] = node.test
dependencies[] = entity dependencies[] = entity
configure = admin/structure/types configure = admin/structure/types
stylesheets[all][] = node.css

View File

@ -1565,19 +1565,19 @@ function template_preprocess_node(&$variables) {
// Gather node classes. // Gather node classes.
$variables['classes_array'][] = drupal_html_class('node-' . $node->type); $variables['classes_array'][] = drupal_html_class('node-' . $node->type);
if ($variables['promote']) { if ($variables['promote']) {
$variables['classes_array'][] = 'node-promoted'; $variables['classes_array'][] = 'promoted';
} }
if ($variables['sticky']) { if ($variables['sticky']) {
$variables['classes_array'][] = 'node-sticky'; $variables['classes_array'][] = 'sticky';
} }
if (!$variables['status']) { if (!$variables['status']) {
$variables['classes_array'][] = 'node-unpublished'; $variables['classes_array'][] = 'unpublished';
} }
if ($variables['teaser']) { if ($variables['view_mode']) {
$variables['classes_array'][] = 'node-teaser'; $variables['classes_array'][] = drupal_html_class('view-mode-' . $variables['view_mode']);
} }
if (isset($variables['preview'])) { if (isset($variables['preview'])) {
$variables['classes_array'][] = 'node-preview'; $variables['classes_array'][] = 'preview';
} }
// Clean up name so there are no underscores. // Clean up name so there are no underscores.

View File

@ -449,7 +449,7 @@ function node_preview($node) {
function theme_node_preview($variables) { function theme_node_preview($variables) {
$node = $variables['node']; $node = $variables['node'];
$output = '<div class="preview">'; $output = '';
$preview_trimmed_version = FALSE; $preview_trimmed_version = FALSE;
@ -469,7 +469,6 @@ function theme_node_preview($variables) {
else { else {
$output .= $full; $output .= $full;
} }
$output .= "</div>\n";
return $output; return $output;
} }
@ -630,6 +629,9 @@ function node_revision_overview($node) {
'#theme' => 'table', '#theme' => 'table',
'#rows' => $rows, '#rows' => $rows,
'#header' => $header, '#header' => $header,
'#attached' => array (
'css' => array(drupal_get_path('module', 'node') . '/node.admin.css'),
),
); );
return $build; return $build;

View File

@ -26,13 +26,13 @@
* - node-[type]: The current node type. For example, if the node is a * - node-[type]: The current node type. For example, if the node is a
* "Article" it would result in "node-article". Note that the machine * "Article" it would result in "node-article". Note that the machine
* name will often be in a short form of the human readable label. * name will often be in a short form of the human readable label.
* - node-teaser: Nodes in teaser form. * - view-mode-[view_mode]: The View Mode of the node e.g. teaser or full.
* - node-preview: Nodes in preview mode. * - preview: Nodes in preview mode.
* The following are controlled through the node publishing options. * The following are controlled through the node publishing options.
* - node-promoted: Nodes promoted to the front page. * - promoted: Nodes promoted to the front page.
* - node-sticky: Nodes ordered above other non-sticky nodes in teaser * - sticky: Nodes ordered above other non-sticky nodes in teaser
* listings. * 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 * - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that * modules, intended to be displayed in front of the main title tag that
* appears in the template. * appears in the template.

View File

@ -806,7 +806,7 @@ class CommonCascadingStylesheetsTestCase extends DrupalWebTestCase {
function testAddCssFileWithQueryString() { function testAddCssFileWithQueryString() {
$this->drupalGet('common-test/query-string'); $this->drupalGet('common-test/query-string');
$query_string = variable_get('css_js_query_string', '0'); $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.')); $this->assertRaw(drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&amp;arg2=value2', t('Query string not escaped on a URI.'));
} }
} }

View File

@ -270,7 +270,7 @@ function common_test_library_info() {
*/ */
function common_test_js_and_css_querystring() { function common_test_js_and_css_querystring() {
drupal_add_js(drupal_get_path('module', 'node') . '/node.js'); 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. // A relative URI may have a query string.
drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2'); drupal_add_css('/' . drupal_get_path('module', 'node') . '/node-fake.css?arg1=value1&arg2=value2');
return ''; return '';

View File

@ -37,6 +37,16 @@ tr.odd {
padding: 0.1em 0.6em; padding: 0.1em 0.6em;
} }
/**
* Publishing status.
*/
.unpublished {
background-color: #fff4f4;
}
.preview {
background-color: #ffffea;
}
/** /**
* Markup generated by theme_tablesort_indicator(). * Markup generated by theme_tablesort_indicator().
*/ */

View File

@ -570,33 +570,28 @@ h1#page-title {
.node .content { .node .content {
font-size: 1.071em; font-size: 1.071em;
} }
.node-teaser .content { .view-mode-teaser .content {
font-size: 1em; font-size: 1em;
} }
.node-teaser h2 { .view-mode-teaser h2 {
margin-top: 0; margin-top: 0;
padding-top: 0.5em; padding-top: 0.5em;
} }
.node-teaser h2 a { .view-mode-teaser h2 a {
color: #181818; color: #181818;
} }
.node-teaser { .view-mode-teaser {
border-bottom: 1px solid #d3d7d9; border-bottom: 1px solid #d3d7d9;
margin-bottom: 30px; margin-bottom: 30px;
padding-bottom: 15px; padding-bottom: 15px;
} }
.node-sticky { .view-mode-teaser.sticky {
background: #f9f9f9; background: #f9f9f9;
background: rgba(0, 0, 0, 0.024); background: rgba(0, 0, 0, 0.024);
border: 1px solid #d3d7d9; border: 1px solid #d3d7d9;
padding: 0 15px 15px; padding: 0 15px 15px;
} }
.node-full { .view-mode-teaser .content {
background: none;
border: none;
padding: 0;
}
.node-teaser .content {
clear: none; clear: none;
line-height: 1.6; line-height: 1.6;
} }
@ -622,8 +617,8 @@ h1#page-title {
.field-type-taxonomy-term-reference ul.links { .field-type-taxonomy-term-reference ul.links {
font-size: 0.8em; font-size: 0.8em;
} }
.node-teaser .field-type-taxonomy-term-reference .field-label, .view-mode-teaser .field-type-taxonomy-term-reference .field-label,
.node-teaser .field-type-taxonomy-term-reference ul.links { .view-mode-teaser .field-type-taxonomy-term-reference ul.links {
font-size: 0.821em; font-size: 0.821em;
} }
.field-type-taxonomy-term-reference ul.links { .field-type-taxonomy-term-reference ul.links {
@ -647,11 +642,11 @@ ul.links {
color: #68696b; color: #68696b;
font-size: 0.821em; font-size: 0.821em;
} }
.node-unpublished { .unpublished {
margin: -20px -15px 0; margin: -20px -15px 0;
padding: 20px 15px 0; padding: 20px 15px 0;
} }
.node-unpublished .comment-text .comment-arrow { .unpublished .comment-text .comment-arrow {
border-left: 1px solid #fff4f4; border-left: 1px solid #fff4f4;
border-right: 1px solid #fff4f4; border-right: 1px solid #fff4f4;
} }

View File

@ -101,15 +101,6 @@ function bartik_process_maintenance_page(&$variables) {
} }
} }
/**
* Override or insert variables into the node template.
*/
function bartik_preprocess_node(&$variables) {
if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) {
$variables['classes_array'][] = 'node-full';
}
}
/** /**
* Override or insert variables into the block template. * Override or insert variables into the block template.
*/ */

View File

@ -26,13 +26,13 @@
* - node-[type]: The current node type. For example, if the node is a * - node-[type]: The current node type. For example, if the node is a
* "Article" it would result in "node-article". Note that the machine * "Article" it would result in "node-article". Note that the machine
* name will often be in a short form of the human readable label. * name will often be in a short form of the human readable label.
* - node-teaser: Nodes in teaser form. * - view-mode-[view_mode]: The View Mode of the node e.g. teaser or full.
* - node-preview: Nodes in preview mode. * - preview: Nodes in preview mode.
* The following are controlled through the node publishing options. * The following are controlled through the node publishing options.
* - node-promoted: Nodes promoted to the front page. * - promoted: Nodes promoted to the front page.
* - node-sticky: Nodes ordered above other non-sticky nodes in teaser * - sticky: Nodes ordered above other non-sticky nodes in teaser
* listings. * 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 * - $title_prefix (array): An array containing additional output populated by
* modules, intended to be displayed in front of the main title tag that * modules, intended to be displayed in front of the main title tag that
* appears in the template. * appears in the template.