Make WordPress Core

Changeset 62592


Ignore:
Timestamp:
06/30/2026 10:30:01 AM (6 weeks ago)
Author:
scruffian
Message:

Toolbar: Make the user avatar image circular.

Make the user avatar in the admin bar circular, both in the top-level toolbar item and the account dropdown. This aligns with the block editor, where avatars are already circular while site logos are square, and follows a common convention that helps distinguish an avatar from a site icon. The avatar is also enlarged slightly on both the desktop and mobile viewports to offset the area lost to the circular crop and to keep it balanced with the surrounding toolbar icons, as follows:

  • Desktop viewport: bump the size from 18px to 20px; add border-radius: 50%
  • Mobile viewport: bump the size from 26px to 28px; add border-radius: 50%

Developed in https://github.com/WordPress/wordpress-develop/pull/11799.

Props fushar, scruffian, joen, sabernhardt, jeryj.
Fixes #64667. See #65083, #65088.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r62349 r62592  
    277277        $howdy = sprintf( __( 'Howdy, %s' ), '<span class="display-name">' . wp_get_current_user()->display_name . '</span>' );
    278278
    279         $avatar = get_avatar( $user_id, 26 );
     279        $avatar = get_avatar( $user_id, 28 );
    280280        $wp_admin_bar->add_node(
    281281                array(
  • trunk/src/wp-includes/css/admin-bar.css

    r62543 r62592  
    456456        width: 64px;
    457457        height: 64px;
     458        border-radius: 50%;
    458459}
    459460
     
    482483#wpadminbar #wp-admin-bar-my-account.with-avatar > a img {
    483484        width: auto;
    484         height: 16px;
     485        height: 20px;
    485486        padding: 0;
    486         border: 1px solid #8c8f94;
     487        border: 1px solid #2c353b;
     488        border-radius: 50%;
    487489        background: #f0f0f1;
    488490        line-height: 1.84615384;
     
    978980        #wpadminbar .quicklinks li#wp-admin-bar-my-account.with-avatar > a img {
    979981                position: absolute;
    980                 top: 13px;
     982                top: 12px;
    981983                right: 10px;
    982                 width: 26px;
    983                 height: 26px;
     984                width: 28px;
     985                height: 28px;
     986                border-radius: 50%;
    984987        }
    985988
Note: See TracChangeset for help on using the changeset viewer.