-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Avatar] Add new sizing 'extra-small' #4371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Thanks for opening your first pull request. A contributor should give feedback soon. If you haven’t already, please check out the contributing guidelines. |
size-limit report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good just a couple of questions. Can you also add an example for extra small in the avatar readme?
And don't forget to add to UNRELEASED.md
I've got the UNRELEASED.md updated and wanted to ask about the I can add the example, but I don't have a best practice direction to go with. |
87fbe4c to
8808589
Compare
UNRELEASED and README updates
8808589 to
f0681d2
Compare
chloerice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 ![]()
|
🎉 Thanks for your contribution to Polaris React! |
WHY are these changes introduced?
I work in Vault Tools and recently with the launch of Debrief the need for a new Avatar sizing came up.

In section Prototypes being reviewed in (exhibit A) we use an Avatar size of 24px to condense the list and reduce whitespace.
The Avatar small size has the following result (exhibit B).

Our designer, @ChrisHS, has also envisioned smaller avatar for single line text components (exhibit C)
Opening this contribution to extend applications of Avatar
WHAT is this pull request doing?
.sizeExtraSmallcss class and added an extra min-width so it doesn't affect the base value for that attr (currently$sizeSmall)extraSmallto Size propSizes for comparrison

How to 🎩
🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines
Copy-paste this code in
playground/Playground.tsx:Additional question:
initialsI saw that the Avatar component does not do any sort of control on that prop. It is clearly designed to handle 2 letters, but if for some reason someone enters 3+ this starts happening:I wonder if we shouldn't have some extra check or control for that. Added a 2nd commit with a suggestion to always crop initials to the first and last in case more than 2 characters are present. It was an arbitrary choice, btw.
🎩 checklist
README.mdwith documentation changes