Administration: Improve the usage of the button CSS classes.

Introduces some consistency in the usage of the button CSS classes, fixes the
focus style for accessibility and responsiveness of the buttons.

- Adds the `button` class to all primary buttons make them responsive
- Removes all `secondary-button` classes and replaces it with button when needed. `button-secondary` shouldn't be used and exists just for backward compatibility reasons
- Replaces classes inside `submit_button()` with a shorthand for some buttons, and use an empty string for the default `button` class. Passing `button` is unnecessary
- Adjusts `get_submit_button()` to remove empty items

Props iseulde, dimchik, chris_d2d, mhowell, afercia.
Fixes #27314, #37138, #37448.


git-svn-id: https://develop.svn.wordpress.org/trunk@38672 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2016-09-28 19:53:07 +00:00
parent 02cf2a731f
commit ee7f970ffa
52 changed files with 126 additions and 125 deletions

View File

@@ -1204,7 +1204,7 @@ body.cheatin p {
* Widgets and Menus common styles
*/
/* higher specificity than .wp-core-ui .button-secondary */
/* higher specificity than .wp-core-ui .button */
#customize-theme-controls .add-new-widget,
#customize-theme-controls .add-new-menu-item {
cursor: pointer;

View File

@@ -221,8 +221,7 @@ table.fixed td {
}
#wpbody-content input.button,
#wpbody-content input.button-primary,
#wpbody-content input.button-secondary {
#wpbody-content input.button-primary {
overflow: visible;
}
@@ -447,8 +446,8 @@ div#dashboard-widgets {
display: block;
}
.tablenav .button-secondary,
.nav .button-secondary {
.tablenav .button,
.nav .button {
padding-top: 2px;
padding-bottom: 2px;
}
@@ -507,7 +506,7 @@ table.ie-fixed {
border-collapse: collapse;
}
.tablenav a.button-secondary {
.tablenav a.button {
display: inline-block;
padding: 2px 5px;
}

View File

@@ -443,7 +443,7 @@ body.language-chooser {
margin-right: 15px;
}
.button-secondary.hide-if-no-js,
.button.hide-if-no-js,
.hide-if-no-js {
display: none;
}

View File

@@ -656,6 +656,7 @@ th.asc a:focus span.sorting-indicator {
margin-left: 2px;
}
.tablenav a.button,
.tablenav a.button-secondary {
display: block;
margin: 3px 8px 0 0;

View File

@@ -114,7 +114,7 @@
margin-right: 3px;
}
.theme-browser .theme .theme-actions .button-secondary {
.theme-browser .theme .theme-actions .button {
float: none;
margin-left: 3px;
}