Make WordPress Core

Opened 9 months ago

Closed 4 months ago

Last modified 4 months ago

#64667 closed enhancement (fixed)

Refine the user dropdown CSS, make the avatar circular

Reported by: Joen Owned by: scruffian
Priority: normal Milestone: 7.1
Component: Toolbar Version:
Severity: minor Keywords: has-patch
Cc: Focuses: ui, css

Description

This is a small, non-urgent, proposal for the WordPress admin-bar user dropdown, to do a few things:

  • Make the avatar circular. This matches avatar usage inside the block editor, but notably can help distinguish from "site logos" which are often square or round-rects.
  • Refine the margins, paddings spacings, of the items inside.
  • Make the username white.

Attachments (2)

mockup.png​ (34.0 KB ) - added by Joen 9 months ago.
Proposed state
after1.png​ (21.4 KB ) - added by Joen 9 months ago.
Closed state

Download all attachments as: .zip

Change History (17)

@Joen
9 months ago

Proposed state

This ticket was mentioned in ​PR #10967 on ​WordPress/wordpress-develop by ​@Joen.


9 months ago
#1

  • Keywords has-patch added; needs-patch removed

This is a small, non-urgent, proposal for the WordPress admin-bar user dropdown, to do a few things:

Make the avatar circular. This matches avatar usage inside the block editor, but notably can help distinguish from "site logos" which are often square or round-rects.
Refine the margins, paddings spacings, of the items inside.
Make the username white.

Trac ticket: https://core.trac.wordpress.org/ticket/64667

## Use of AI Tools

No.

@Joen
9 months ago

Closed state

#2 @sabernhardt
9 months ago

  • Component Menus → Toolbar

#3 @sabernhardt
9 months ago

  • Focuses css added
  • Version trunk

This ticket was mentioned in ​PR #11799 on ​WordPress/wordpress-develop by ​@fushar.


6 months ago
#4

Trac ticket: https://core.trac.wordpress.org/ticket/64667

### Summary

Make the user avatar in the admin bar circular 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%

The size changes are made to make it look balanced with the rest of the icons in the admin bar.

This PR strictly updates the avatar on admin bar only. I did not update, for example, in profile.php page. I think it's better to let it display the original image without circular modification.

### Desktop

Before
https://github.com/user-attachments/assets/a7dcac13-7556-4b57-872a-8f0720787bb6

After
https://github.com/user-attachments/assets/25f02685-72a5-4075-a374-3d1165c6fb01

Before After
https://github.com/user-attachments/assets/0e1bfa47-0c90-42fb-8ec6-7d701b479f64 https://github.com/user-attachments/assets/f7532946-7067-495d-8f11-e2e357cf91ff

### Mobile

Before After
https://github.com/user-attachments/assets/384d67be-b6f6-4375-9fd2-5446f24404c4 https://github.com/user-attachments/assets/52a0b3f1-44b6-4a50-b54f-d02d3efcb288

## Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.7
Used for: CSS and screenshots generation.

#5 @fushar
6 months ago

Hi @Joen! The original PR is not compatible with certain color schemes, as I commented in the PR. I suggest we keep this proposal small: let's start with making the avatar circular only.

I am proposing a new PR which does that + adjusted the size and padding to make the circular avatar balanced in the admin bar.

#6 @Joen
6 months ago

Sounds good! I'm happy to close the PR in favor of yours; the motivation is the circular avatar!

#7 @fushar
5 months ago

I believe this change adds a more modern touch the admin bar, and is pretty harmless. @sabernhardt, what do you think if we move this forward?

#8 @sabernhardt
5 months ago

#65083 also proposes a circular image, and @joedolson already voiced disagreement about the shape. One of these tickets probably should be closed as a duplicate of the other, even though they are not exactly the same.

I do not like trimming everyone's avatars to a circle, especially in both the top-level link and the dropdown. That hides more than 21% of the image (the area of the circle compared to the square is a ratio of pi to 4).

Among the generated avatar options, Identicon and Retro seem to be the least appropriate in a circle. The circle works with the Mystery Person image in these screenshots, but then why not update the Gravatar image itself?

The Credits page already has circular avatars for the noteworthy contributors, and those 63 generally seem fine. Several of them are missing a little of their hair or a hat; some of Isabel's cat is hidden. A few have a cropped microphone, so it is not immediately obvious what the person is holding.

However, the average WordPress user could have anything in the hidden area. I would be most concerned with photos that include two or more people, where faces could easily extend outside the circle.

​@scruffian commented on ​PR #11799:


4 months ago
#9

A useful observation:

When a user creates a profile image in Gravatar, we display the image inside a circle:

https://github.com/user-attachments/assets/94fd12dd-cefc-4cc7-a51d-67aace7e175f

Even though the image can be displayed as a square in some contexts, showing this preview sets an expectation that user's images will be displayed in a circle.

​@scruffian commented on ​PR #11799:


4 months ago
#10

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%

Just noting that the sizes are actually 22px and 30px when you include the borders.

#11 @jeryj
4 months ago

From a design and modernization standpoint, I think of most profile avatars as circular. If I'm going to upload an avatar, I assume it will be used as a circle at some point.

I don't see a strong accessibility argument for using a square over a circle. IMO, the information lost in the corners is unlikely to make a difference to the user's ability to understand the image as the avatar they uploaded. I think worst case scenario is that the user's image is not cropped in their preferred spot. Open to being proved wrong here :)

I'd support a square or circle avatar, but prefer circular to fit the overall modernization of the design.

#13 @scruffian
4 months ago

I left this comment on the PR but it didn't get synced:

IMO this change makes sense:

  • In the block editor avatars are already circular and site logos already square, so this aligns with that convention.
  • Using circular avatars is a common convention - Chrome, Google, OSX, GitHub etc. all use this convention.
  • Using a circle creates a distinction between the site icon and the avatar - this could be particularly useful if #11781 lands and some users have the same icon for their site and avatar. > - This difference is also distinguishable even when colour and internal detail are stripped away (high-contrast mode, greyscale, very low acuity).
  • Increasing the avatar size compensates the size lost by making the avatar circular.
  • The avatars are already shown at a small size so any detail shown inside each image is hard to discern anyway.

#14 @scruffian
4 months ago

  • Owner set to scruffian
  • Resolution → fixed
  • Status new → closed

In 62592:

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.

#15 @sabernhardt
4 months ago

  • Milestone Awaiting Review → 7.1
Note: See TracTickets for help on using tickets.