Skip to content

Commit

Permalink
Wrap AvatarStack avatars in isolation: isolate to create a new st…
Browse files Browse the repository at this point in the history
…acking context (#5705)

* Wrap `AvatarStack` avatars in `isolation: isolate`

* Create strange-pets-stare.md

* Snap!
  • Loading branch information
iansan5653 authored Feb 26, 2025
1 parent 0ecc07f commit 2857a8e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-pets-stare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/react": patch
---

Fix `AvatarStack` stacking `z-index` bugs by creating a new stacking context around the component
1 change: 1 addition & 0 deletions packages/react/src/AvatarStack/AvatarStack.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
display: flex;
min-width: var(--avatar-stack-size);
height: var(--avatar-stack-size);
isolation: isolate;

&:where([data-responsive]) {
@media screen and (--viewportRange-narrow) {
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/AvatarStack/AvatarStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const AvatarStackWrapper = toggleStyledComponent(
position: relative;
height: var(--avatar-stack-size);
min-width: var(--avatar-stack-size);
isolation: isolate;
.pc-AvatarStackBody {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`Avatar respects alignRight props 1`] = `
position: relative;
height: var(--avatar-stack-size);
min-width: var(--avatar-stack-size);
isolation: isolate;
--avatar-stack-size: 20px;
}
Expand Down

0 comments on commit 2857a8e

Please sign in to comment.