Skip to content

Commit 304382e

Browse files
committed
Accessibility: Make buttons to add site images look like buttons.
The buttons to add site icons, logos, header images, and background images were designed with a dashed border. This led to confusion with users thinking they were drop regions for image uploads, rather than buttons to trigger an upload. Change design of upload buttons to clarify expected user interaction. Props emaildano, afercia, joedolson, ankitkumarshah, logicrays, shailu25. Fixes #47579. Built from https://develop.svn.wordpress.org/trunk@60645 git-svn-id: http://core.svn.wordpress.org/trunk@59981 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 parent e2442c0 commit 304382e

15 files changed

+52
-68
lines changed

wp-admin/css/customize-controls-rtl.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,6 +1442,21 @@ p.customize-section-description {
14421442
white-space: normal;
14431443
}
14441444

1445+
.customize-control .attachment-media-view .upload-button {
1446+
width: 100%;
1447+
padding: 9px 0;
1448+
}
1449+
1450+
.customize-control .attachment-media-view .upload-button.control-focus {
1451+
width: auto;
1452+
padding: 0 10px;
1453+
}
1454+
1455+
.customize-control.customize-control-header .actions .upload-button.button.new {
1456+
width: 100%;
1457+
padding: 9px 0;
1458+
}
1459+
14451460
.customize-control .attachment-media-view .thumbnail,
14461461
.customize-control-header .current .container {
14471462
overflow: hidden;
@@ -2991,6 +3006,10 @@ body.adding-widget .add-new-widget:before,
29913006
vertical-align: middle;
29923007
}
29933008

3009+
.customize-control .attachment-media-view .upload-button {
3010+
padding: 5px 0;
3011+
}
3012+
29943013
#customize-control-changeset_status .customize-inside-control-row {
29953014
padding-top: 15px;
29963015
}

wp-admin/css/customize-controls-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/customize-controls.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,21 @@ p.customize-section-description {
14411441
white-space: normal;
14421442
}
14431443

1444+
.customize-control .attachment-media-view .upload-button {
1445+
width: 100%;
1446+
padding: 9px 0;
1447+
}
1448+
1449+
.customize-control .attachment-media-view .upload-button.control-focus {
1450+
width: auto;
1451+
padding: 0 10px;
1452+
}
1453+
1454+
.customize-control.customize-control-header .actions .upload-button.button.new {
1455+
width: 100%;
1456+
padding: 9px 0;
1457+
}
1458+
14441459
.customize-control .attachment-media-view .thumbnail,
14451460
.customize-control-header .current .container {
14461461
overflow: hidden;
@@ -2990,6 +3005,10 @@ body.adding-widget .add-new-widget:before,
29903005
vertical-align: middle;
29913006
}
29923007

3008+
.customize-control .attachment-media-view .upload-button {
3009+
padding: 5px 0;
3010+
}
3011+
29933012
#customize-control-changeset_status .customize-inside-control-row {
29943013
padding-top: 15px;
29953014
}

wp-admin/css/customize-controls.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/forms-rtl.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -790,32 +790,6 @@ ul#add-to-blog-users {
790790
outline: 2px solid transparent;
791791
}
792792

793-
.button-add-site-icon {
794-
width: 100%;
795-
cursor: pointer;
796-
text-align: center;
797-
border: 1px dashed #c3c4c7;
798-
box-sizing: border-box;
799-
padding: 9px 0;
800-
line-height: 1.6;
801-
max-width: 270px;
802-
border-radius: 4px;
803-
background: #f0f0f1;
804-
}
805-
806-
.button-add-site-icon:focus,
807-
.button-add-site-icon:hover {
808-
background: #fff;
809-
}
810-
811-
.button-add-site-icon:focus {
812-
background-color: #fff;
813-
border-color: #3582c4;
814-
border-style: solid;
815-
box-shadow: 0 0 0 1px #3582c4;
816-
outline: 2px solid transparent;
817-
}
818-
819793
/*------------------------------------------------------------------------------
820794
15.0 - Comments Screen
821795
------------------------------------------------------------------------------*/

wp-admin/css/forms-rtl.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/css/forms.css

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -789,32 +789,6 @@ ul#add-to-blog-users {
789789
outline: 2px solid transparent;
790790
}
791791

792-
.button-add-site-icon {
793-
width: 100%;
794-
cursor: pointer;
795-
text-align: center;
796-
border: 1px dashed #c3c4c7;
797-
box-sizing: border-box;
798-
padding: 9px 0;
799-
line-height: 1.6;
800-
max-width: 270px;
801-
border-radius: 4px;
802-
background: #f0f0f1;
803-
}
804-
805-
.button-add-site-icon:focus,
806-
.button-add-site-icon:hover {
807-
background: #fff;
808-
}
809-
810-
.button-add-site-icon:focus {
811-
background-color: #fff;
812-
border-color: #3582c4;
813-
border-style: solid;
814-
box-shadow: 0 0 0 1px #3582c4;
815-
outline: 2px solid transparent;
816-
}
817-
818792
/*------------------------------------------------------------------------------
819793
15.0 - Comments Screen
820794
------------------------------------------------------------------------------*/

wp-admin/css/forms.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wp-admin/options-general.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
wp_enqueue_media();
106106
wp_enqueue_script( 'site-icon' );
107107

108-
$classes_for_upload_button = 'upload-button button-add-media button-add-site-icon';
108+
$classes_for_upload_button = 'upload-button button-hero button';
109109
$classes_for_update_button = 'button';
110110
$classes_for_wrapper = '';
111111

wp-includes/customize/class-wp-customize-header-image-control.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ public function print_header_image_template() {
173173
<img src="{{data.header.thumbnail_url}}" alt="{{data.header.alt_text || data.header.description}}" />
174174

175175
<# } #>
176-
<# } else { #>
177-
178-
<div class="placeholder">
179-
<?php _e( 'No image set' ); ?>
180-
</div>
181-
182176
<# } #>
183177
</script>
184178
<?php
@@ -246,7 +240,7 @@ public function render_content() {
246240
<div class="actions">
247241
<?php if ( current_user_can( 'upload_files' ) ) : ?>
248242
<button type="button"<?php echo $visibility; ?> class="button remove" aria-label="<?php esc_attr_e( 'Hide header image' ); ?>"><?php _e( 'Hide image' ); ?></button>
249-
<button type="button" class="button new" id="header_image-button" aria-label="<?php esc_attr_e( 'Add Header Image' ); ?>"><?php _e( 'Add Image' ); ?></button>
243+
<button type="button" class="button new <?php echo ! $this->get_current_image_src() ? '' : 'customize-header-image-not-selected'; ?>" id="header_image-button" aria-label="<?php esc_attr_e( 'Add Header Image' ); ?>"><?php _e( 'Add Image' ); ?></button>
250244
<?php endif; ?>
251245
</div>
252246
<div class="choices">

0 commit comments

Comments
 (0)