Make WordPress Core

Changeset 58405


Ignore:
Timestamp:
06/13/2024 01:55:46 PM (6 months ago)
Author:
joedolson
Message:

Administration: A11y: Add visible labels in theme UI.

Finish task to replace placeholders used for labels with visible label elements. Add label elements in theme browser and theme installation screen. Change position of search input to match other user interfaces in WordPress.

Also crediting all contributors to ticket #61389, which this also closes.

Props joedolson, rcreators, sabernhardt, balub, rejaulalomkhan, syamraj24, nazmul111, krupajnanda, huzaifaalmesbah, hmbashar, mdnesarmridha, colorful-tones, printsachen1.
Fixes #40331, #61389.

Location:
trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/wp/theme.js

    r57987 r58405  
    9797
    9898    // Defines search element container.
    99     searchContainer: $( '.search-form' ),
     99    searchContainer: $( '.search-form .search-box' ),
    100100
    101101    // Search input and view
     
    119119        view.render();
    120120        this.searchContainer
    121             .append( $.parseHTML( '<label class="screen-reader-text" for="wp-filter-search-input">' + l10n.search + '</label>' ) )
     121            .append( $.parseHTML( '<label for="wp-filter-search-input">' + l10n.search + '</label>' ) )
    122122            .append( view.el )
    123123            .on( 'submit', function( event ) {
     
    13601360
    13611361    attributes: {
    1362         placeholder: l10n.searchPlaceholder,
    13631362        type: 'search',
    13641363        'aria-describedby': 'live-search-desc'
  • trunk/src/wp-admin/css/themes.css

    r57553 r58405  
    2020}
    2121
    22 .themes-php:not(.network-admin) .wrap h1 {
    23     margin-bottom: 15px;
    24 }
    25 
    2622.themes-php .wrap h1 .button {
    2723    margin-left: 20px;
     
    3026/* Search form */
    3127.themes-php .search-form {
    32     display: inline;
     28    display: inline-flex;
     29    align-items: center;
     30    position: relative;
     31    top: 0;
     32    gap: .5rem;
     33    width: 100%;
     34    justify-content: end;
    3335}
    3436
    3537.themes-php .wp-filter-search {
    3638    position: relative;
    37     top: -2px;
    38     left: 20px;
    3939    margin: 0;
    4040    width: 280px;
     
    956956        left: 0;
    957957        right: 0;
    958         margin: -5px 0 20px;
    959958        width: 100%;
    960959        max-width: 280px;
     960    }
     961
     962    .theme-install-php .wp-filter p.search-box {
     963        display: grid;
     964        row-gap: .5rem;
    961965    }
    962966
     
    10281032.theme-install-php .wp-filter {
    10291033    padding-left: 20px;
     1034}
     1035
     1036/* Override column gap adjustment in media library. */
     1037@media only screen and (max-width: 1000px) {
     1038    .theme-install-php .wp-filter p.search-box {
     1039        column-gap: .5rem;
     1040    }
    10301041}
    10311042
  • trunk/src/wp-admin/network/site-themes.php

    r56409 r58405  
    238238
    239239<form method="get">
    240 <?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
     240<?php $wp_list_table->search_box( __( 'Search installed themes' ), 'theme' ); ?>
    241241<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
    242242</form>
  • trunk/src/wp-admin/network/themes.php

    r56601 r58405  
    461461
    462462<form method="get">
    463 <?php $wp_list_table->search_box( __( 'Search Installed Themes' ), 'theme' ); ?>
     463<?php $wp_list_table->search_box( __( 'Search installed themes' ), 'theme' ); ?>
    464464</form>
    465465
  • trunk/src/wp-admin/theme-install.php

    r58069 r58405  
    5757            'addNew'              => __( 'Add New Theme' ),
    5858            'search'              => __( 'Search Themes' ),
    59             'searchPlaceholder'   => __( 'Search themes...' ), // Placeholder (no ellipsis).
    6059            'upload'              => __( 'Upload Theme' ),
    6160            'back'                => __( 'Back' ),
     
    218217        <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button>
    219218
    220         <form class="search-form"></form>
     219        <form class="search-form"><p class="search-box"></p></form>
    221220
    222221        <div class="favorites-form">
  • trunk/src/wp-admin/themes.php

    r58069 r58405  
    233233        'l10n'     => array(
    234234            'addNew'            => __( 'Add New Theme' ),
    235             'search'            => __( 'Search Installed Themes' ),
    236             'searchPlaceholder' => __( 'Search installed themes...' ), // Placeholder (no ellipsis).
     235            'search'            => __( 'Search installed themes' ),
    237236            /* translators: %d: Number of themes. */
    238237            'themesFound'       => __( 'Number of Themes found: %d' ),
     
    253252        <span class="title-count theme-count"><?php echo ! empty( $_GET['search'] ) ? __( '&hellip;' ) : count( $themes ); ?></span>
    254253    </h1>
    255 
    256254    <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
    257255        <a href="<?php echo esc_url( admin_url( 'theme-install.php' ) ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html__( 'Add New Theme' ); ?></a>
    258256    <?php endif; ?>
    259 
    260     <form class="search-form"></form>
    261 
    262257    <hr class="wp-header-end">
     258    <form class="search-form search-themes"><p class="search-box"></p></form>
     259
    263260<?php
    264261if ( ! validate_current_theme() || isset( $_GET['broken'] ) ) {
Note: See TracChangeset for help on using the changeset viewer.