Skip to content

Commit 2303172

Browse files
committed
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 WordPress#11799. Props fushar, scruffian, joen, sabernhardt, jeryj. Fixes #64667. See #65083, #65088. git-svn-id: https://develop.svn.wordpress.org/trunk@62592 602fd350-edb4-49c9-b593-d223f7449a82
1 parent ffbc198 commit 2303172

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/wp-includes/admin-bar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ function wp_admin_bar_my_account_item( $wp_admin_bar ) {
276276
/* translators: %s: Current user's display name. */
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(
282282
'id' => 'my-account',

src/wp-includes/css/admin-bar.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,7 @@ html:lang(he-il) .rtl #wpadminbar * {
455455
top: 4px;
456456
width: 64px;
457457
height: 64px;
458+
border-radius: 50%;
458459
}
459460

460461
#wpadminbar #wp-admin-bar-user-info a {
@@ -481,9 +482,10 @@ html:lang(he-il) .rtl #wpadminbar * {
481482
#wpadminbar #wp-admin-bar-my-account.with-avatar > .ab-empty-item img,
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;
489491
vertical-align: middle;
@@ -977,10 +979,11 @@ html:lang(he-il) .rtl #wpadminbar * {
977979

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

986989
#wpadminbar #wp-admin-bar-user-actions.ab-submenu {

0 commit comments

Comments
 (0)