Make WordPress Core

Changeset 60645


Ignore:
Timestamp:
08/18/2025 08:25:45 PM (4 months ago)
Author:
joedolson
Message:

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.

Location:
trunk/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/customize/views.js

    r43347 r60645  
    3838        setButtons: function() {
    3939            var elements = $('#customize-control-header_image .actions .remove');
     40            var addButton = $('#customize-control-header_image .actions .new');
     41
    4042            if (this.model.get('choice')) {
    4143                elements.show();
     44                addButton.removeClass('upload-button');
    4245            } else {
    4346                elements.hide();
     47                addButton.addClass('upload-button');
    4448            }
    4549        }
  • trunk/src/wp-admin/css/customize-controls.css

    r59989 r60645  
    14401440    height: auto;
    14411441    white-space: normal;
     1442}
     1443
     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;
    14421457}
    14431458
     
    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;
  • trunk/src/wp-admin/css/forms.css

    r60636 r60645  
    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
  • trunk/src/wp-admin/options-general.php

    r59806 r60645  
    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       = '';
  • trunk/src/wp-includes/customize/class-wp-customize-header-image-control.php

    r59784 r60645  
    174174
    175175                <# } #>
    176             <# } else { #>
    177 
    178             <div class="placeholder">
    179                 <?php _e( 'No image set' ); ?>
    180             </div>
    181 
    182176            <# } #>
    183177        </script>
     
    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>
  • trunk/src/wp-includes/customize/class-wp-customize-media-control.php

    r57766 r60645  
    197197            <div class="attachment-media-view">
    198198                <# if ( data.canUpload ) { #>
    199                     <button type="button" class="upload-button button-add-media" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button>
     199                    <button type="button" class="upload-button button" {{{ describedByAttr }}}>{{ data.button_labels.select }}</button>
    200200                <# } #>
    201201                <div class="actions">
  • trunk/src/wp-includes/customize/class-wp-customize-site-icon-control.php

    r58927 r60645  
    127127            <div class="attachment-media-view">
    128128                <# if ( data.canUpload ) { #>
    129                     <button type="button" class="upload-button button-add-media"><?php echo $this->button_labels['site_icon']; ?></button>
     129                    <button type="button" class="upload-button button"><?php echo $this->button_labels['site_icon']; ?></button>
    130130                <# } #>
    131131                <div class="actions">
Note: See TracChangeset for help on using the changeset viewer.