Make WordPress Core

Ticket #40331: 40331.themes.diff

File 40331.themes.diff, 8.7 KB (added by joedolson, 15 months ago)

Patch removing placeholders in customizer theme searches

  • src/js/_enqueues/wp/customize/controls.js

     
    19171917                        section.contentContainer.on( 'click', '.feature-filter-toggle', function( e ) {
    19181918                                var $themeContainer = $( '.customize-themes-full-container' ),
    19191919                                        $filterToggle = $( e.currentTarget );
    1920                                 section.filtersHeight = $filterToggle.parent().next( '.filter-drawer' ).height();
     1920                                section.filtersHeight = $filterToggle.parents( '.themes-filter-bar' ).next( '.filter-drawer' ).height();
    19211921
    19221922                                if ( 0 < $themeContainer.scrollTop() ) {
    19231923                                        $themeContainer.animate( { scrollTop: 0 }, 400 );
     
    19321932                                        .attr( 'aria-expanded', function( i, attr ) {
    19331933                                                return 'true' === attr ? 'false' : 'true';
    19341934                                        })
    1935                                         .parent().next( '.filter-drawer' ).slideToggle( 180, 'linear' );
     1935                                        .parents( '.themes-filter-bar' ).next( '.filter-drawer' ).slideToggle( 180, 'linear' );
    19361936
    19371937                                if ( $filterToggle.hasClass( 'open' ) ) {
    19381938                                        var marginOffset = 1018 < window.innerWidth ? 50 : 76;
  • src/wp-admin/css/customize-controls.css

     
    18151815        bottom: 0;
    18161816}
    18171817
    1818 .themes-filter-bar .feature-filter-toggle {
    1819         float: right;
    1820         margin: 3px 0 3px 25px;
    1821 }
    1822 
    18231818.themes-filter-bar .feature-filter-toggle:before {
    18241819        content: "\f111";
    18251820        margin: 0 5px 0 0;
     
    18801875        animation: .6s themes-fade-in 1;
    18811876}
    18821877
    1883 .control-panel-themes .filter-themes-count {
    1884         position: relative;
    1885         float: right;
    1886         line-height: 2.6;
    1887 }
    1888 
    18891878.control-panel-themes .filter-themes-count .themes-displayed {
    18901879        font-weight: 600;
    18911880        color: #50575e;
     
    20972086        box-sizing: border-box;
    20982087        border-bottom: 1px solid #dcdcde;
    20992088}
     2089.customize-preview-header.themes-filter-bar,
     2090.customize-preview-header.themes-filter-bar .search-form {
     2091        display: flex;
     2092        align-items: center;
     2093        gap: 10px;
     2094        flex-wrap: wrap;
     2095}
    21002096
     2097.customize-preview-header.themes-filter-bar .search-form-input {
     2098        position: relative;
     2099}
     2100
     2101.customize-preview-header .filter-themes-wrapper {
     2102        display: grid;
     2103        align-items: center;
     2104        gap: 10px;
     2105        grid-template-columns: auto 1fr;
     2106}
     2107
     2108.customize-preview-header .filter-themes-wrapper .filter-themes-count {
     2109        justify-self: end;
     2110}
     2111
    21012112@media screen and (min-width: 1670px) {
    21022113        .customize-preview-header.themes-filter-bar {
    21032114                width: 82%;
     
    21092120.themes-filter-bar .themes-filter-container {
    21102121        margin: 0;
    21112122        padding: 0;
     2123        display: flex;
     2124        align-items: center;
     2125        gap: 10px;
    21122126}
    21132127
    21142128.themes-filter-bar .wp-filter-search {
     
    21172131        max-width: 100%;
    21182132        width: 40%;
    21192133        min-width: 300px;
    2120         position: absolute;
    2121         top: 6px;
    2122         left: 25px;
    21232134        height: 32px;
    21242135        margin: 1px 0;
     2136        top: 0;
     2137        left: 0;
    21252138}
    21262139
     2140.themes-filter-bar .wp-filter-search label {
     2141        vertical-align:
     2142}
     2143
    21272144/* Unstick the filter bar on short windows/screens. This breakpoint is based on the
    21282145   current length of .org feature filters assuming translations do not wrap lines. */
    21292146@media screen and (max-height: 540px), screen and (max-width: 1018px) {
     
    21572174
    21582175@media screen and (max-width: 900px) {
    21592176        .customize-preview-header.themes-filter-bar {
    2160                 height: 86px;
    2161                 padding-top: 46px;
     2177                height: 96px;
    21622178        }
    21632179
    21642180        .themes-filter-bar .wp-filter-search {
    2165                 width: calc(100% - 50px);
     2181                width: 100%;
    21662182                margin: 0;
    21672183                min-width: 200px;
    21682184        }
    21692185
     2186        .customize-preview-header.themes-filter-bar,
     2187        .customize-preview-header.themes-filter-bar .search-form
     2188        .themes-filter-bar .themes-filter-container {
     2189                display: grid;
     2190                gap: 4px;
     2191        }
     2192
     2193        .customize-preview-header.themes-filter-bar .search-form-input {
     2194                display: flex;
     2195                flex-grow: 1;
     2196        }
     2197
     2198        .customize-preview-header.themes-filter-bar .search-icon {
     2199                top: 6px;
     2200        }
     2201
    21702202        .filter-drawer {
    21712203                top: 86px;
    21722204        }
     
    26952727
    26962728.themes-filter-bar .search-icon {
    26972729        position: absolute;
    2698         top: 7px;
    2699         left: 26px;
     2730        top: 2px;
     2731        left: 2px;
    27002732        z-index: 1;
    27012733        color: #646970;
    27022734        height: 30px;
     
    28142846                margin-top: 12px;
    28152847        }
    28162848
    2817         .wp-core-ui .themes-filter-bar .feature-filter-toggle {
    2818                 margin: 3px 0 3px 25px;
    2819         }
    28202849}
    28212850
    28222851@media screen and (max-width: 1200px) {
     
    29642993        .reordering .reorder-done {
    29652994                padding: 8px;
    29662995        }
    2967 
    2968         .wp-core-ui .themes-filter-bar .feature-filter-toggle {
    2969                 margin: 0;
    2970         }
    29712996}
    29722997
    29732998@media screen and (max-width: 600px) {
  • src/wp-includes/customize/class-wp-customize-themes-section.php

     
    124124                <button type="button" class="button button-primary customize-section-back customize-themes-mobile-back"><?php _e( 'Go to theme sources' ); ?></button>
    125125                <# if ( 'wporg' === data.action ) { #>
    126126                        <div class="search-form">
    127                                 <label for="wp-filter-search-input-{{ data.id }}" class="screen-reader-text">
    128                                         <?php
    129                                         /* translators: Hidden accessibility text. */
    130                                         _e( 'Search themes&hellip;' );
    131                                         ?>
    132                                 </label>
    133                                 <input type="search" id="wp-filter-search-input-{{ data.id }}" placeholder="<?php esc_attr_e( 'Search themes&hellip;' ); ?>" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search">
    134                                 <div class="search-icon" aria-hidden="true"></div>
    135                                 <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
    136                                         <?php
    137                                         /* translators: Hidden accessibility text. */
    138                                         _e( 'The search results will be updated as you type.' );
    139                                         ?>
    140                                 </span>
     127                                <label for="wp-filter-search-input-{{ data.id }}"><?php _e( 'Search themes' ); ?></label>
     128                                <div class="search-form-input">
     129                                        <input type="search" id="wp-filter-search-input-{{ data.id }}" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search">
     130                                        <div class="search-icon" aria-hidden="true"></div>
     131                                        <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
     132                                                <?php
     133                                                /* translators: Hidden accessibility text. */
     134                                                _e( 'The search results will be updated as you type.' );
     135                                                ?>
     136                                        </span>
     137                                </div>
    141138                        </div>
     139                <# } else { #>
     140                        <div class="themes-filter-container">
     141                                <label for="{{ data.id }}-themes-filter"><?php _e( 'Search themes' ); ?></label>
     142                                <div class="search-form-input">
     143                                        <input type="search" id="{{ data.id }}-themes-filter" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search wp-filter-search-themes" />
     144                                        <div class="search-icon" aria-hidden="true"></div>
     145                                        <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
     146                                                <?php
     147                                                /* translators: Hidden accessibility text. */
     148                                                _e( 'The search results will be updated as you type.' );
     149                                                ?>
     150                                        </span>
     151                                </div>
     152                        </div>
     153                <# } #>
     154                <div class="filter-themes-wrapper">
     155                        <# if ( 'wporg' === data.action ) { #>
    142156                        <button type="button" class="button feature-filter-toggle">
    143157                                <span class="filter-count-0"><?php _e( 'Filter themes' ); ?></span><span class="filter-count-filters">
    144158                                        <?php
     
    147161                                        ?>
    148162                                </span>
    149163                        </button>
    150                 <# } else { #>
    151                         <div class="themes-filter-container">
    152                                 <label for="{{ data.id }}-themes-filter" class="screen-reader-text">
     164                        <# } #>
     165                        <div class="filter-themes-count">
     166                                <span class="themes-displayed">
    153167                                        <?php
    154                                         /* translators: Hidden accessibility text. */
    155                                         _e( 'Search themes&hellip;' );
     168                                        /* translators: %s: Number of themes displayed. */
     169                                        printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
    156170                                        ?>
    157                                 </label>
    158                                 <input type="search" id="{{ data.id }}-themes-filter" placeholder="<?php esc_attr_e( 'Search themes&hellip;' ); ?>" aria-describedby="{{ data.id }}-live-search-desc" class="wp-filter-search wp-filter-search-themes" />
    159                                 <div class="search-icon" aria-hidden="true"></div>
    160                                 <span id="{{ data.id }}-live-search-desc" class="screen-reader-text">
    161                                         <?php
    162                                         /* translators: Hidden accessibility text. */
    163                                         _e( 'The search results will be updated as you type.' );
    164                                         ?>
    165171                                </span>
    166172                        </div>
    167                 <# } #>
    168                 <div class="filter-themes-count">
    169                         <span class="themes-displayed">
    170                                 <?php
    171                                 /* translators: %s: Number of themes displayed. */
    172                                 printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
    173                                 ?>
    174                         </span>
    175173                </div>
    176174                <?php
    177175        }