diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 0d0e739..7866fd7 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -2686,9 +2686,6 @@ function template_preprocess(&$variables, $hook) { 'title_attributes' => array(), 'content_attributes' => array(), ); - - // Initialize html class attribute for the current hook. - $variables['attributes']['class'][] = drupal_html_class($hook); } /** @@ -2732,6 +2729,7 @@ function template_preprocess_html(&$variables) { // Compile a list of classes that are going to be applied to the body element. // This allows advanced theming based on context (home page, node of certain type, etc.). + $variables['attributes']['class'][] = 'html'; // Add a class that tells us whether we're on the front page or not. $variables['attributes']['class'][] = $variables['is_front'] ? 'front' : 'not-front'; // Add a class that tells us whether the page is viewed by an authenticated user or not. @@ -3109,6 +3107,7 @@ function template_preprocess_maintenance_page(&$variables) { $variables['title'] = drupal_get_title(); // Compile a list of classes that are going to be applied to the body element. + $variables['attributes']['class'][] = 'maintenance-page'; $variables['attributes']['class'][] = 'in-maintenance'; if (isset($variables['db_is_active']) && !$variables['db_is_active']) { $variables['attributes']['class'][] = 'db-offline'; @@ -3169,6 +3168,7 @@ function template_preprocess_region(&$variables) { $variables['content'] = $variables['elements']['#children']; $variables['region'] = $variables['elements']['#region']; + $variables['attributes']['class'][] = 'region'; $variables['attributes']['class'][] = drupal_region_class($variables['region']); $variables['theme_hook_suggestions'][] = 'region__' . $variables['region']; } diff --git a/core/modules/block/block.module b/core/modules/block/block.module index db497e3..d94ec3b 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -539,6 +539,7 @@ function template_preprocess_block(&$variables) { $variables['label'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; $variables['content'] = $variables['elements']['content']; + $variables['attributes']['class'][] = 'block'; $variables['attributes']['class'][] = drupal_html_class('block-' . $variables['configuration']['module']); // Add default class for block content. diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 7d848d6..74e24cd 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1646,6 +1646,7 @@ function template_preprocess_comment(&$variables) { } // Gather comment classes. + $variables['attributes']['class'][] = 'comment'; // 'published' class is not needed, it is either 'preview' or 'unpublished'. if ($variables['status'] != 'published') { $variables['attributes']['class'][] = $variables['status']; @@ -1724,6 +1725,9 @@ function template_preprocess_comment_wrapper(&$variables) { $variables['display_mode'] = variable_get('comment_default_mode_' . $variables['node']->type, COMMENT_MODE_THREADED); // The comment form is optional and may not exist. $variables['content'] += array('comment_form' => array()); + + // Add comment wrapper class + $variables['attributes']['class'][] = 'comment-wrapper'; } /** diff --git a/core/modules/layout/lib/Drupal/layout/Plugin/Layout/StaticLayout.php b/core/modules/layout/lib/Drupal/layout/Plugin/Layout/StaticLayout.php index ead803b..b48528a 100644 --- a/core/modules/layout/lib/Drupal/layout/Plugin/Layout/StaticLayout.php +++ b/core/modules/layout/lib/Drupal/layout/Plugin/Layout/StaticLayout.php @@ -82,6 +82,9 @@ public function renderLayout($admin = FALSE, $regions = array()) { $build = array( '#theme' => $definition['theme'], '#content' => array(), + '#attributes' => array( + 'class' => drupal_html_class($definition['theme']) + ), ); // Render all regions needed for this layout. diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 0605169..6bb9b6f 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -1186,6 +1186,7 @@ function template_preprocess_node(&$variables) { $variables['attributes']['role'] = 'article'; // Gather node classes. + $variables['attributes']['class'][] = 'node'; $variables['attributes']['class'][] = drupal_html_class('node-' . $node->type); if ($node->promote) { $variables['attributes']['class'][] = 'promoted'; diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module index 31289d5..1566740 100644 --- a/core/modules/overlay/overlay.module +++ b/core/modules/overlay/overlay.module @@ -519,6 +519,10 @@ function template_preprocess_overlay(&$variables) { $variables['tabs'] = menu_primary_local_tasks(); $variables['title'] = drupal_get_title(); $variables['disable_overlay'] = overlay_disable_message(); + + // Add atrributes for the overlay container. + $variables['attributes']['class'][] = 'overlay'; + // Add attributes for the overlay content. $variables['content_attributes']['class'][] = 'clearfix'; } diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module index d576b54..419e0ba 100644 --- a/core/modules/taxonomy/taxonomy.module +++ b/core/modules/taxonomy/taxonomy.module @@ -490,6 +490,7 @@ function template_preprocess_taxonomy_term(&$variables) { field_attach_preprocess($term, $variables['content'], $variables); // Gather classes, and clean up name so there are no underscores. + $variables['attributes']['class'][] = 'taxonomy-term'; $vocabulary_name_css = str_replace('_', '-', $term->bundle()); $variables['attributes']['class'][] = 'vocabulary-' . $vocabulary_name_css; diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc index 4178bac..e5435a8 100644 --- a/core/modules/views/views.theme.inc +++ b/core/modules/views/views.theme.inc @@ -636,6 +636,7 @@ function template_preprocess_views_view_table(&$vars) { } $vars['attributes']['class'][] = 'views-table'; + $vars['attributes']['class'][] = 'views-view-table'; if (empty($vars['rows']) && !empty($options['empty_table'])) { $build = $view->display_handler->renderArea('empty'); $vars['rows'][0][0] = drupal_render($build); diff --git a/core/modules/views_ui/views_ui.theme.inc b/core/modules/views_ui/views_ui.theme.inc index 841f15c..08bc405 100644 --- a/core/modules/views_ui/views_ui.theme.inc +++ b/core/modules/views_ui/views_ui.theme.inc @@ -24,6 +24,8 @@ function template_preprocess_views_ui_display_tab_setting(&$variables) { array_unshift($variables['settings_links'], $variables['link']); $variables['settings_links'] = implode(' | ', $variables['settings_links']); + $variables['attributes']['class'][] = 'views-ui-display-tab-setting'; + if (!empty($variables['defaulted'])) { $variables['attributes']['class'][] = 'defaulted'; } @@ -41,6 +43,8 @@ function template_preprocess_views_ui_display_tab_setting(&$variables) { function template_preprocess_views_ui_display_tab_bucket(&$variables) { $element = $variables['element']; + $variables['attributes']['class'][] = 'views-ui-display-tab-bucket'; + if (!empty($element['#name'])) { $variables['attributes']['class'][] = drupal_html_class($element['#name']); }