Make WordPress Core

Ticket #43633: 43633.6.diff

File 43633.6.diff, 3.1 KB (added by joedolson, 11 months ago)

Changes item heights to be measured in rem instead of px so menu items are still readable when font size is increased.

  • src/wp-includes/admin-bar.php

     
    139139                                __( 'About WordPress' ) .
    140140                        '</span>',
    141141                'href'  => $about_url,
    142                 'meta' => array(
     142                'meta'  => array(
    143143                        'menu_title' => __( 'About WordPress' ),
    144144                ),
    145145        );
     
    286286                        'href'   => $profile_url,
    287287                        'meta'   => array(
    288288                                'class'      => $class,
     289                                /* translators: %s: Current user's display name. */
    289290                                'menu_title' => sprintf( __( 'Howdy, %s' ), $current_user->display_name ),
     291                                'tabindex'   => ( false !== $profile_url ) ? '' : 0,
    290292                        ),
    291293                )
    292294        );
     
    329331                $user_info .= "<span class='username'>{$current_user->user_login}</span>";
    330332        }
    331333
    332         $user_info .= "<span class='edit-profile'>" . __( 'Edit Profile' ) . '</span>';
     334        if ( false !== $profile_url ) {
     335                $user_info .= "<span class='display-name edit-profile'>" . __( 'Edit Profile' ) . '</span>';
     336        }
    333337
    334338        $wp_admin_bar->add_node(
    335339                array(
     
    389393                        'id'    => 'site-name',
    390394                        'title' => $title,
    391395                        'href'  => ( is_admin() || ! current_user_can( 'read' ) ) ? home_url( '/' ) : admin_url(),
    392                         'meta' => array(
     396                        'meta'  => array(
    393397                                'menu_title' => $title,
    394398                        ),
    395399                )
     
    990994                        'id'    => 'new-content',
    991995                        'title' => $title,
    992996                        'href'  => admin_url( current( array_keys( $actions ) ) ),
    993                         'meta' => array(
     997                        'meta'  => array(
    994998                                'menu_title' => _x( 'New', 'admin bar menu group label' ),
    995999                        ),
    9961000                )
  • src/wp-includes/class-wp-admin-bar.php

     
    506506         * @since 6.5.0 Added `$menu_title` parameter to allow an ARIA menu name.
    507507         *
    508508         * @param object $node
    509          * @param string|bool $menu_title The accessible name of this aria menu or false if not provided.
     509         * @param string|bool $menu_title The accessible name of this ARIA menu or false if not provided.
    510510         */
    511511        final protected function _render_group( $node, $menu_title = false ) {
    512512                if ( 'container' === $node->type ) {
  • src/wp-includes/css/admin-bar.css

     
    187187#wpadminbar.nojs .quicklinks .menupop:hover ul li .ab-item,
    188188#wpadminbar .shortlink-input {
    189189        line-height: 2;
    190         height: 26px;
     190        height: 1.875rem;
    191191        white-space: nowrap;
    192192        min-width: 140px;
    193193}
     
    447447        background: none;
    448448}
    449449
    450 #wpadminbar #wp-admin-bar-user-info a {
    451         display: grid;
    452         row-gap: 12px;
    453 }
    454 
    455450#wp-admin-bar-user-info .avatar {
    456451        position: absolute;
    457452        left: -72px;
     
    468463#wpadminbar #wp-admin-bar-user-info span {
    469464        background: none;
    470465        padding: 0;
    471         height: 18px;
     466        height: 1.125rem;
    472467}
    473468
    474469#wpadminbar #wp-admin-bar-user-info .display-name,