Make WordPress Core

Changeset 59825


Ignore:
Timestamp:
02/14/2025 08:32:48 PM (19 months ago)
Author:
joedolson
Message:

Customize: Accessibility: Restore heading semantics in sections.

Remove role="presentation" from headings in the customizer. These were needed to avoid confusing semantics when the headings also acted as buttons to control accordions, changed in [59924].

Change responsive CSS to use screen-reader-text styling rather than display: none so that mobile retains the headings hierarchy.

Props joedolson, hbhalodia, mikinc860, guillaumeturpin, rcreators, tirth03, dhrumilk .
Fixes #62215.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/customize-controls.css

    r59772 r59825  
    448448        font-size: 13px;
    449449        line-height: 1.9;
     450        margin: 0;
     451        font-weight: 400;
     452        color: #50575e;
    450453}
    451454
     
    26422645#available-widgets .customize-section-title,
    26432646#available-menu-items .customize-section-title {
     2647        border: 0;
     2648        clip-path: inset(50%);
     2649        height: 1px;
     2650        margin: -1px;
     2651        overflow: hidden;
     2652        padding: 0;
     2653        position: absolute;
     2654        width: 1px;
     2655        word-wrap: normal !important;
     2656}
     2657
     2658#available-widgets .customize-section-title button,
     2659#available-menu-items .customize-section-title button {
    26442660        display: none;
    26452661}
     
    29782994        #available-widgets .customize-section-title,
    29792995        #available-menu-items .customize-section-title {
     2996                border: 0;
     2997                clip-path: none;
     2998                height: inherit;
     2999                margin: 0;
     3000                overflow: hidden;
     3001                padding: 0;
     3002                width: auto;
     3003                position: static;
     3004        }
     3005
     3006        #available-widgets .customize-section-title button,
     3007        #available-menu-items .customize-section-title button {
    29803008                display: block;
    2981                 margin: 0;
    29823009        }
    29833010
  • trunk/src/wp-admin/customize.php

    r59789 r59825  
    234234                                <div id="customize-info" class="accordion-section customize-info" data-block-theme="<?php echo (int) wp_is_block_theme(); ?>">
    235235                                        <div class="accordion-section-title">
    236                                                 <span class="preview-notice">
     236                                                <h2 class="preview-notice">
    237237                                                <?php
    238238                                                        /* translators: %s: The site/panel title in the Customizer. */
    239239                                                        printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
    240240                                                ?>
    241                                                 </span>
     241                                                </h2>
    242242                                                <button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text">
    243243                                                        <?php
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r59224 r59825  
    12231223                ?>
    12241224                <div id="<?php echo esc_attr( $id ); ?>" class="accordion-section">
    1225                         <h4 class="accordion-section-title" role="presentation">
     1225                        <h4 class="accordion-section-title">
    12261226                                <button type="button" class="accordion-trigger" aria-expanded="false" aria-controls="<?php echo esc_attr( $id ); ?>-content">
    12271227                                        <?php echo esc_html( $available_item_type['title'] ); ?>
     
    12581258                ?>
    12591259                <div id="new-custom-menu-item" class="accordion-section">
    1260                         <h4 class="accordion-section-title" role="presentation">
     1260                        <h4 class="accordion-section-title">
    12611261                                <button type="button" class="accordion-trigger" aria-expanded="false" aria-controls="new-custom-menu-item-content">
    12621262                                        <?php _e( 'Custom Links' ); ?>
Note: See TracChangeset for help on using the changeset viewer.