Accessibility: Replace media placeholder clickable divs with buttons.

`<button>` elements are natively interactive, supported by any assistive technology, and must be used instead of non-semantic, non-accessible `<div>` elements.

Also, this change aligns the Media Widgets and the Customizer site icon and site logo controls with the design pattern used in the new Block Editor for similar controls.

Props ramonopoly, welcher, afercia.
Fixes #43151.


git-svn-id: https://develop.svn.wordpress.org/trunk@44796 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia
2019-03-05 17:49:00 +00:00
parent da4f8d0ffb
commit 951b462ea2
7 changed files with 231 additions and 181 deletions

View File

@@ -84,6 +84,7 @@
margin-right: 8px;
}
.media-widget-control .attachment-media-view .button-add-media,
.media-widget-control .placeholder {
border: 1px dashed #b4b9be;
box-sizing: border-box;
@@ -95,6 +96,26 @@
width: 100%;
}
.media-widget-control .attachment-media-view .button-add-media {
cursor: pointer;
background-color: #edeff0;
color: #32373c;
}
.media-widget-control .attachment-media-view .button-add-media:hover {
background-color: #fbfbfc;
}
.media-widget-control .attachment-media-view .button-add-media:focus {
background-color: #fbfbfc;
border-style: solid;
border-color: #5b9dd9;
box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
/* Only visible in Windows High Contrast mode */
outline: 2px solid transparent;
outline-offset: -2px;
}
.media-widget-control .media-widget-preview {
background: transparent;
text-align: center;