Skip to content

Evenly space AvatarStack #5911

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

joeoak
Copy link

@joeoak joeoak commented Apr 9, 2025

Changelog

Changed

Proposed:

  • Avatars in AvatarStack are evenly spaced apart
  • Avatars in AvatarStack do not progressively fade in opacity

Risks:

Diff:

Before After
Current AvatarStack. Spacing between avatars varies depending on index. Updated AvatarStack. Avatars are evenly spaced apart.
avatarStack-250409.mp4

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

Copy link

changeset-bot bot commented Apr 9, 2025

⚠️ No Changeset found

Latest commit: 5ea313b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Apr 9, 2025
Copy link
Contributor

github-actions bot commented Apr 9, 2025

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Apr 9, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 104.32 KB (-0.12% 🔽)
packages/react/dist/browser.umd.js 104.68 KB (-0.08% 🔽)

/* stylelint-disable-next-line alpha-value-notation */
opacity: calc(100% - 4 * var(--opacity-step));
}

&:nth-child(n + 6) {
Copy link
Author

@joeoak joeoak Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be variable? Consumers of AvatarStack can decide on the max amount of avatars to show at rest 🤔

}

&:where([data-avatar-count='3+']) {
/*
MIN-WIDTH CALC FORMULA EXPLAINED:
avatar size ➡️ var(--avatar-stack-size)
plus the visible part of the 2nd avatar ➡️ var(--avatar-stack-size) - var(--overlap-size)
plus the visible part of the 3rd AND 4th avatar ➡️ (var(--avatar-stack-size) - var(--overlap-size-avatar-three-plus)) * 2
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, the max amount of avatars that can be displayed at rest is 5 - shouldn't the min-width include the 5th avatar?

@lesliecdubs
Copy link
Member

👋🏻 Hey @joeoak, thanks for giving this fix a go! Is it ready for review?

@joeoak
Copy link
Author

joeoak commented Apr 28, 2025

hey @lesliecdubs! I opened this as more of a proposal 😅 - so I think we still need to align on whether this is the right design decision

cc @lukasoppermann @mperrotti

@lukasoppermann
Copy link
Contributor

Hey, I am on board with the change in general, but would suggested to decrease spacing the more items are added, to reduce the overall size when 4 or 5 Avatars are displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants