Make WordPress Core


Ignore:
Timestamp:
06/30/2026 08:17:07 PM (3 months ago)
Author:
joedolson
Message:

Admin Reskin: Fix interactive control heights on mobile.

Give interactive elements a consistent 40px height in the admin mobile viewport on the Add Plugins, Media Library grid, Settings > General, and Add Themes screens.

Follow-up to [61645].
Reviewed by joedolson.
Merges [62516] to the 7.0 branch.

Props abcd95, wildworks.
Fixes #64999.

Location:
branches/7.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/7.0

  • branches/7.0/src/wp-admin/themes.php

    r61195 r62603  
    382382
    383383                        if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) {
    384                                 $current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
     384                                $current_theme_actions[] = "<a class='button button-compact$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
    385385                        } else {
    386                                 $current_theme_actions[] = "<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
     386                                $current_theme_actions[] = "<a class='button button-compact$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
    387387                        }
    388388                } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
    … …  
    391391                        if ( current_user_can( 'customize' ) ) {
    392392                                if ( 'custom-header' === $menu_file ) {
    393                                         $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
     393                                        $current_theme_actions[] = "<a class='button button-compact hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
    394394                                } elseif ( 'custom-background' === $menu_file ) {
    395                                         $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
     395                                        $current_theme_actions[] = "<a class='button button-compact hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
    396396                                }
    397397                        }
    … …  
    403403
    404404                        if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
    405                                 $current_theme_actions[] = "<a class='button$class' href='{$item[2]}'>{$item[0]}</a>";
     405                                $current_theme_actions[] = "<a class='button button-compact$class' href='{$item[2]}'>{$item[0]}</a>";
    406406                        } else {
    407                                 $current_theme_actions[] = "<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
     407                                $current_theme_actions[] = "<a class='button button-compact$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
    408408                        }
    409409                }
    … …  
    610610                                $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), $theme['name'] );
    611611                                ?>
    612                                 <a class="button button-primary customize load-customize hide-if-no-customize"
     612                                <a class="button button-compact button-primary customize load-customize hide-if-no-customize"
    613613                                        href="<?php echo esc_url( $theme['actions']['customize'] ); ?>"
    614614                                        aria-label="<?php echo esc_attr( $customize_aria_label ); ?>"
    … …  
    620620                        $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    621621                        ?>
    622                         <a class="button activate"
     622                        <a class="button button-compact activate"
    623623                                href="<?php echo esc_url( $theme['actions']['activate'] ); ?>"
    624624                                aria-label="<?php echo esc_attr( $aria_label ); ?>"
    … …  
    631631                                $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    632632                                ?>
    633                                 <a class="button button-primary load-customize hide-if-no-customize"
     633                                <a class="button button-compact button-primary load-customize hide-if-no-customize"
    634634                                        href="<?php echo esc_url( $theme['actions']['customize'] ); ?>"
    635635                                        aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    … …  
    641641                        $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
    642642                        ?>
    643                         <a class="button disabled"
     643                        <a class="button button-compact disabled"
    644644                                aria-label="<?php echo esc_attr( $aria_label ); ?>"
    645645                        ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    … …  
    650650                                $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    651651                                ?>
    652                                 <a class="button button-primary hide-if-no-customize disabled"
     652                                <a class="button button-compact button-primary hide-if-no-customize disabled"
    653653                                        aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    654654                                ><?php _e( 'Live Preview' ); ?></a>
    … …  
    10021002                                        $customize_aria_label = sprintf( _x( 'Customize %s', 'theme' ), '{{ data.name }}' );
    10031003                                        ?>
    1004                                         <a class="button button-primary customize load-customize hide-if-no-customize"
     1004                                        <a class="button button-compact button-primary customize load-customize hide-if-no-customize"
    10051005                                                href="{{{ data.actions.customize }}}"
    10061006                                                aria-label="<?php echo esc_attr( $customize_aria_label ); ?>"
    … …  
    10131013                                        $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    10141014                                        ?>
    1015                                         <a class="button activate"
     1015                                        <a class="button button-compact activate"
    10161016                                                href="{{{ data.actions.activate }}}"
    10171017                                                aria-label="<?php echo esc_attr( $aria_label ); ?>"
    … …  
    10221022                                        $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    10231023                                        ?>
    1024                                         <a class="button button-primary load-customize hide-if-no-customize"
     1024                                        <a class="button button-compact button-primary load-customize hide-if-no-customize"
    10251025                                                href="{{{ data.actions.customize }}}"
    10261026                                                aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    … …  
    10311031                                        $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
    10321032                                        ?>
    1033                                         <a class="button disabled"
     1033                                        <a class="button button-compact disabled"
    10341034                                                aria-label="<?php echo esc_attr( $aria_label ); ?>"
    10351035                                        ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    … …  
    10391039                                        $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    10401040                                        ?>
    1041                                         <a class="button button-primary hide-if-no-customize disabled"
     1041                                        <a class="button button-compact button-primary hide-if-no-customize disabled"
    10421042                                                aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    10431043                                        ><?php _e( 'Live Preview' ); ?></a>
    … …  
    12521252                <div class="theme-actions">
    12531253                        <div class="active-theme">
    1254                                 <a class="button button-primary customize load-customize hide-if-no-customize"
     1254                                <a class="button button-compact button-primary customize load-customize hide-if-no-customize"
    12551255                                        href="{{{ data.actions.customize }}}"
    12561256                                ><?php _e( 'Customize' ); ?></a>
    … …  
    12641264                                        $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    12651265                                        ?>
    1266                                         <a class="button button-primary load-customize hide-if-no-customize"
     1266                                        <a class="button button-compact button-primary load-customize hide-if-no-customize"
    12671267                                                href="{{{ data.actions.customize }}}"
    12681268                                                aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    … …  
    12741274                                                $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
    12751275                                                ?>
    1276                                                 <a class="button activate"
     1276                                                <a class="button button-compact activate"
    12771277                                                        href="{{{ data.actions.activate }}}"
    12781278                                                        aria-label="<?php echo esc_attr( $aria_label ); ?>"
    … …  
    12841284                                        $live_preview_aria_label = sprintf( _x( 'Live Preview %s', 'theme' ), '{{ data.name }}' );
    12851285                                        ?>
    1286                                         <a class="button button-primary hide-if-no-customize disabled"
     1286                                        <a class="button button-compact button-primary hide-if-no-customize disabled"
    12871287                                                aria-label="<?php echo esc_attr( $live_preview_aria_label ); ?>"
    12881288                                        ><?php _e( 'Live Preview' ); ?></a>
    … …  
    12931293                                                $aria_label = sprintf( _x( 'Cannot Activate %s', 'theme' ), '{{ data.name }}' );
    12941294                                                ?>
    1295                                                 <a class="button disabled"
     1295                                                <a class="button button-compact disabled"
    12961296                                                        aria-label="<?php echo esc_attr( $aria_label ); ?>"
    12971297                                                ><?php _ex( 'Cannot Activate', 'theme' ); ?></a>
    … …  
    13051305                                $aria_label = sprintf( _x( 'Delete %s', 'theme' ), '{{ data.name }}' );
    13061306                                ?>
    1307                                 <a class="button delete-theme"
     1307                                <a class="button button-compact delete-theme"
    13081308                                        href="{{{ data.actions['delete'] }}}"
    13091309                                        aria-label="<?php echo esc_attr( $aria_label ); ?>"
Note: See TracChangeset for help on using the changeset viewer.