diff --git a/core/themes/seven/css/layout/node-add.css b/core/themes/seven/css/layout/node-add.css index dc2b105..7f5274a 100644 --- a/core/themes/seven/css/layout/node-add.css +++ b/core/themes/seven/css/layout/node-add.css @@ -10,11 +10,14 @@ @media screen and (min-width: 780px), (orientation: landscape) and (min-device-height: 780px) { + .node-form-layout .messages { + margin-top: 1em; + margin-bottom: 1em; + } } @media screen and (max-width: 1020px), (orientation: landscape) and (max-device-height: 1020px) { - .toolbar-vertical .block-list-secondary, .toolbar-vertical .layout-region-node-secondary { margin-bottom: 0; diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index ccd1c92..7f05e4d 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -232,3 +232,16 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { $form['revision_information']['#type'] = 'container'; $form['revision_information']['#group'] = 'meta'; } + + function seven_preprocess_html(&$variables) { + + // If on a node add or edit page, add a node-layout class. + $path_args = explode('/', current_path()); + if ($suggestions = theme_get_suggestions($path_args, 'page', '-')) { + foreach ($suggestions as $suggestion) { + if ( $suggestion === 'page-node-edit' || strpos($suggestion,'page-node-add') !== false) { + $variables['attributes']['class'][] = drupal_html_class('node-form-layout'); + } + } + } +}