diff --git a/core/includes/form.inc b/core/includes/form.inc index d74dcf7..3a7ed98 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -3941,7 +3941,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'][] = 'form-button'; + if (!empty($element['#button_type'])) { + $element['#attributes']['class'][] = 'form-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/lib/Drupal/Core/Entity/EntityFormController.php b/core/lib/Drupal/Core/Entity/EntityFormController.php index c4ebe28..5e503a1 100644 --- a/core/lib/Drupal/Core/Entity/EntityFormController.php +++ b/core/lib/Drupal/Core/Entity/EntityFormController.php @@ -96,6 +96,12 @@ protected function actionsElement(array $form, array &$form_state) { $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 d2a7e81..5584e63 100644 --- a/core/modules/user/lib/Drupal/user/ProfileFormController.php +++ b/core/modules/user/lib/Drupal/user/ProfileFormController.php @@ -21,16 +21,10 @@ protected function actions(array $form, array &$form_state) { $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/bartik/css/style-rtl.css b/core/themes/bartik/css/style-rtl.css index 90638eb..15013a7 100644 --- a/core/themes/bartik/css/style-rtl.css +++ b/core/themes/bartik/css/style-rtl.css @@ -148,10 +148,18 @@ ul.tips { /* ----------------- Buttons ------------------ */ input.form-submit, -a.button { +.form-actions .form-button, +.form-actions .form-submit { margin-right: 0; margin-left: 0.6em; } +@media screen and (max-width: 37.5em) { /* 600px */ + input.form-submit, + .form-actions .form-button, + .form-actions .form-submit { + margin-left: 0; + } +} /* --------------- Search Form ---------------- */ diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css index 6f4cb14..2e2be9b 100644 --- a/core/themes/bartik/css/style.css +++ b/core/themes/bartik/css/style.css @@ -128,7 +128,7 @@ table, input, textarea, select, -a.button { +.form-button { font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif; } @@ -1086,7 +1086,7 @@ div.password-confirm { /* ---------------- Buttons ---------------- */ input.form-submit, -a.button { +.form-button { background: #fff url(../images/buttons.png) 0 0 repeat-x; border: 1px solid #e4e4e4; border-bottom: 1px solid #b4b4b4; @@ -1102,11 +1102,9 @@ a.button { padding: 4px 17px; border-radius: 15px; } -a.button:link, -a.button:visited, -a.button:hover, -a.button:focus, -a.button:active { +.form-button:hover, +.form-button:focus, +.form-button:active { text-decoration: none; color: #5a5a5a; } @@ -1243,6 +1241,18 @@ input.form-submit:focus { .form-actions { padding-top: 10px; } +.form-actions .form-button, +.form-actions .form-submit { + margin-right: 0.6em; /* LTR */ +} +@media screen and (max-width: 37.5em) { /* 600px */ + .form-actions .form-button, + .form-actions .form-submit { + margin-top: 0.5em; + margin-right: 0; /* LTR */ + width: 100%; + } +} /* Contact Form */ .contact-form #edit-name { width: 75%; diff --git a/core/themes/seven/style-rtl.css b/core/themes/seven/style-rtl.css index 788aa36..0acaff1 100644 --- a/core/themes/seven/style-rtl.css +++ b/core/themes/seven/style-rtl.css @@ -140,7 +140,7 @@ body div.form-type-checkbox div.description { margin-right: 1.5em; } input.form-submit, -a.button { +.form-button { margin-left: 1em; margin-right: 0; } @@ -154,6 +154,19 @@ ul.action-links a { background-position: right center; } +/* Form actions */ +.form-actions .form-button, +.form-actions .form-submit { + margin-right: 0; + margin-left: 1em; +} +@media screen and (max-width: 37.5em) { /* 600px */ + .form-actions .form-button, + .form-actions .form-submit { + margin-left: 0; + } +} + /* Update options. */ div.admin-options label, div.admin-options div.form-item { diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index 7b8ae1b..48704ed 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -627,7 +627,7 @@ body div.form-type-checkbox div.description { margin-left: 1.5em; /* LTR */ } input.form-submit, -a.button { +.form-button { cursor: pointer; padding: 4px 17px; margin-bottom: 1em; @@ -644,16 +644,12 @@ a.button { background: url(images/buttons.png) 0 0 repeat-x; border-radius: 20px; } -a.button:link, -a.button:visited, -a.button:hover, -a.button:active { +.form-button:hover, +.form-button:active { text-decoration: none; } -input.form-submit:hover, -input.form-submit:focus, -a.button:hover, -a.button:focus { +.form-button:focus, +.form-button:hover { background-position: 0 -40px; border: 1px solid #bebebe; border-left-color: #afafaf; @@ -661,8 +657,7 @@ a.button:focus { border-bottom-color: #9b9b9b; color: #2e2e2e; } -input.form-submit:active, -a.button:active { +.form-button:active { background-position: 0 -80px; border: 1px solid #333; border-left-color: #222; @@ -671,6 +666,23 @@ a.button:active { color: #fff; text-shadow: #222 0 -1px 0; } +.form-button-primary { + background: #9dcae7 none; + border: 1px solid #8eB7cd; + border-bottom-color: #7691a2; + color: #133B54; +} +.form-button-primary:focus, +.form-button-primary:hover { + background: #73b3dd none; + border: 1px solid #6ea3bf; + border-bottom-color: #4680a0; +} +.form-button-primary:active { + background: #3981b1; + border: 1px solid #36647c; + border-bottom-color: #284657; +} input.form-button-disabled, input.form-button-disabled:active { background: #eee none; @@ -806,6 +818,23 @@ div.filter-options select { padding: 0; } +/* Form actions */ +.form-actions { + margin-top: 1em; +} +.form-actions .form-button, +.form-actions .form-submit { + margin-right: 1em; /* LTR */ +} +@media screen and (max-width: 37.5em) { /* 600px */ + .form-actions .form-button, + .form-actions .form-submit { + margin-top: 0.5em; + margin-right: 0; /* LTR */ + width: 100%; + } +} + /** * System. */