diff --git a/core/includes/form.inc b/core/includes/form.inc index 362d0d5..10dc26c 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -3892,7 +3892,13 @@ function theme_button($variables) { $element['#attributes']['type'] = 'submit'; element_set_attributes($element, array('id', 'name', 'value')); - $element['#attributes']['class'][] = 'form-' . $element['#button_type']; + $element['#attributes']['class'][] = 'button'; + if (!empty($element['#button_type'])) { + $element['#attributes']['class'][] = 'button-' . $element['#button_type']; + } + else { + $element['#attributes']['class'][] = 'form-submit'; + } if (!empty($element['#attributes']['disabled'])) { $element['#attributes']['class'][] = 'form-button-disabled'; } diff --git a/core/modules/entity/lib/Drupal/entity/EntityFormController.php b/core/modules/entity/lib/Drupal/entity/EntityFormController.php index 4f1263c..e40f041 100644 --- a/core/modules/entity/lib/Drupal/entity/EntityFormController.php +++ b/core/modules/entity/lib/Drupal/entity/EntityFormController.php @@ -96,6 +96,12 @@ class EntityFormController implements EntityFormControllerInterface { $delete = $element['delete']; unset($element['delete']); $element['delete'] = $delete; + $element['delete']['#button_type'] = 'delete'; + } + + if (isset($element['submit'])) { + // Give the primary submit button a #button_type of primary. + $element['submit']['#button_type'] = 'primary'; } $count = 0; diff --git a/core/modules/user/lib/Drupal/user/ProfileFormController.php b/core/modules/user/lib/Drupal/user/ProfileFormController.php index d32cf4a..de71840 100644 --- a/core/modules/user/lib/Drupal/user/ProfileFormController.php +++ b/core/modules/user/lib/Drupal/user/ProfileFormController.php @@ -21,16 +21,10 @@ class ProfileFormController extends AccountFormController { $element = parent::actions($form, $form_state); $account = $this->getEntity($form_state); - // @todo Actually the cancel action can be assimilated to the delete one: we - // should alter it instead of providing a new one. - unset($element['delete']); - - $element['cancel'] = array( - '#type' => 'submit', - '#value' => t('Cancel account'), - '#submit' => array('user_edit_cancel_submit'), - '#access' => $account->uid > 1 && (($account->uid == $GLOBALS['user']->uid && user_access('cancel account')) || user_access('administer users')), - ); + $element['delete']['#type'] = 'submit'; + $element['delete']['#value'] = t('Cancel account'); + $element['delete']['#submit'] = array('user_edit_cancel_submit'); + $element['delete']['#access'] = $account->uid > 1 && (($account->uid == $GLOBALS['user']->uid && user_access('cancel account')) || user_access('administer users')); return $element; } diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index f1e7321..493bfac 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -602,7 +602,7 @@ body div.form-type-checkbox div.description { margin-left: 1.5em; /* LTR */ } input.form-submit, -a.button { +.button { cursor: pointer; padding: 4px 17px; margin-bottom: 1em; @@ -620,22 +620,33 @@ a.button { -moz-border-radius: 20px; border-radius: 20px; } -a.button:link, -a.button:visited, -a.button:hover, -a.button:active { +.button:link, +.button:visited, +.button:hover, +.button:active { text-decoration: none; color: #5a5a5a; } -.node-form input#edit-submit, -.node-form input#edit-submit-1 { +.button-primary { border: 1px solid #8eB7cd; border-left-color: #8eB7cd; border-right-color: #8eB7cd; border-bottom-color: #7691a2; - background: url(images/buttons.png) 0 -40px repeat-x; + background: #9dcae7 none; color: #133B54; } +.button-delete { + background: #ed522f none; + border-color: #91311c; + color: #fff; +} +.button-delete:link, +.button-delete:visited, +.button-delete:hover, +.button-delete:active { + text-decoration: none; + color: #e5e5e5; +} input.form-submit:active { background: #666; color: #fff; @@ -714,6 +725,29 @@ div.filter-options select { padding: 0; } +/* Form actions */ +.form-actions { + margin-top: 1em; +} +.form-actions > * { + margin-right: 1em; /* LTR; @todo RTL */ +} +.form-action-group { + display: inline-block; +} +.button-delete { + float: right; /* LTR; @todo RTL */ + margin-right: 0; /* LTR; @todo RTL */ + width: auto; +} +@media screen and (max-width: 600px) { + .form-actions * { + margin-top: 0.5em; + margin-right: 0; /* LTR; @todo RTL */ + width: 100%; + } +} + /** * System. */