diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 3f6d623..c475e1d 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1656,27 +1656,29 @@ function template_preprocess_html(&$variables) { $variables['page'] = $page; // 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.). + // This allows advanced theming based on context (home page, node of certain + // type, etc.). $body_classes = $variables['attributes']['class']; - $body_classes[] = 'html'; - // Add a class that tells us whether we're on the front page or not. - $body_classes[] = $variables['is_front'] ? 'front' : 'not-front'; - // Add a class that tells us whether the page is viewed by an authenticated user or not. - $body_classes[] = $variables['logged_in'] ? 'logged-in' : 'not-logged-in'; - $variables['attributes']['class'] = $body_classes; - $path_args = explode('/', current_path()); - // Populate the body classes. - if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) { - foreach ($suggestions as $suggestion) { - if ($suggestion != 'page-front') { - // Add current suggestion to page classes to make it possible to theme - // the page depending on the current page type (e.g. node, admin, user, - // etc.) as well as more specific data like node-12 or node-edit. - $variables['attributes']['class'][] = drupal_html_class($suggestion); - } - } + // Add a class that tells us whether the page is viewed by an authenticated + // user. + if ($variables['logged_in']) { + $body_classes[] = 'user-logged-in'; } + // Add a class that tells us what path the page is located make it possible + // to theme the page depending on the current path (e.g. node, admin, user, + // etc.) as well as more specific data like path-frontpage. + $path = \Drupal::request()->getPathInfo(); + + if (drupal_is_front_page()) { + $body_classes[] = 'path-frontpage'; + } + else { + $segment = explode('/', $path); + $body_classes[] = 'path-' . drupal_html_class($segment[1]); + } + + $variables['attributes']['class'] = $body_classes; $site_config = \Drupal::config('system.site'); // Construct page title. @@ -1766,15 +1768,6 @@ function template_preprocess_page(&$variables) { } } - // Set up layout variable. - $variables['layout'] = 'none'; - if (!empty($variables['page']['sidebar_first'])) { - $variables['layout'] = 'first'; - } - if (!empty($variables['page']['sidebar_second'])) { - $variables['layout'] = ($variables['layout'] == 'first') ? 'both' : 'second'; - } - $variables['base_path'] = base_path(); $variables['front_page'] = url(); $variables['language'] = $language_interface; @@ -1878,16 +1871,16 @@ function template_preprocess_page(&$variables) { */ function theme_get_suggestions($args, $base, $delimiter = '__') { - // Build a list of suggested theme hooks or body classes in order of + // Build a list of suggested theme hooks in order of // specificity. One suggestion is made for every element of the current path, // though numeric elements are not carried to subsequent suggestions. For // example, for $base='page', http://www.example.com/node/1/edit would result - // in the following suggestions and body classes: + // in the following suggestions: // - // page__node page-node - // page__node__% page-node-% - // page__node__1 page-node-1 - // page__node__edit page-node-edit + // page__node + // page__node__% + // page__node__1 + // page__node__edit $suggestions = array(); $prefix = $base; @@ -1942,7 +1935,6 @@ function template_preprocess_maintenance_page(&$variables) { $attributes = $page_object->getBodyAttributes(); $classes = $attributes['class']; $classes[] = 'maintenance-page'; - $classes[] = 'in-maintenance'; if (isset($variables['db_is_active']) && !$variables['db_is_active']) { $classes[] = 'db-offline'; } diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 6470a33..56259d4 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -1790,34 +1790,6 @@ div.add-or-remove-shortcuts { padding-top: 0.9em; } -/* ---------- Admin-specific Theming ---------- */ - -.page-admin #content img { - margin-right: 15px; /* LTR */ -} -.page-admin #content .simpletest-image img { - margin: 0; -} -.page-admin-structure-block-demo .block-region { - background: #ffff66; - border: 1px dotted #9f9e00; - color: #000; - font: 90% "Lucida Grande", "Lucida Sans Unicode", sans-serif; - margin: 5px; - padding: 5px; - text-align: center; - text-shadow: none; -} -.page-admin-structure-block-demo #featured .block-region { - font-size: 0.55em; -} -.page-admin-structure-block-demo #header .block-region { - width: 500px; -} -.page-admin #admin-dblog img { - margin: 0 5px; -} - /* Configuration. */ div.admin .right, div.admin .left { diff --git a/core/themes/seven/css/layout/node-add.css b/core/themes/seven/css/layout/node-add.css index 6bbe892..dc2b105 100644 --- a/core/themes/seven/css/layout/node-add.css +++ b/core/themes/seven/css/layout/node-add.css @@ -10,12 +10,6 @@ @media screen and (min-width: 780px), (orientation: landscape) and (min-device-height: 780px) { - - [class*="page-node-add-"] .messages, - .page-node-edit .messages { - margin-top: 1em; - margin-bottom: 1em; - } } @media screen and (max-width: 1020px), diff --git a/core/themes/seven/css/theme/install-page.css b/core/themes/seven/css/theme/install-page.css index d114dac..c9d124d 100644 --- a/core/themes/seven/css/theme/install-page.css +++ b/core/themes/seven/css/theme/install-page.css @@ -3,7 +3,7 @@ * Installation styling. * * Unfortunately we have to make our styling quite strong, to override the - * .in-maintenance styling. + * .maintenance-page styling. */ .install-background { background-color: #1275b2; diff --git a/core/themes/seven/css/theme/maintenance-page.css b/core/themes/seven/css/theme/maintenance-page.css index 80b18f9..edf9018 100644 --- a/core/themes/seven/css/theme/maintenance-page.css +++ b/core/themes/seven/css/theme/maintenance-page.css @@ -13,7 +13,7 @@ /* Maintenance theming */ .install-page, -.in-maintenance { +.maintenance-page { background: none; } .page-title { @@ -131,13 +131,13 @@ html { display: table; } - .in-maintenance, - .install-page { + .install-page, + .maintenance-page { display: table-cell; padding: 1em 0; vertical-align: middle; } - html, .install-page, .in-maintenance { + html, .install-page, .maintenance-page { margin: 0; width: 100%; height: 100%;