Skip to content

Commit 7a8d4ff

Browse files
[Avatar] Override SE23 background override with imageHasLoaded (#10211)
### WHY are these changes introduced? Fixes #10203 ### WHAT is this pull request doing? Changing Avatar background to transparent if there is an image passed in ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 7a36121 commit 7a8d4ff

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.changeset/popular-pumas-sin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Ensure Avatar has no background color if an source prop is passed in to allow for transparent images

polaris-react/src/components/Avatar/Avatar.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
// stylelint-enable
2929
background: var(--p-color-avatar-background-experimental);
3030
color: var(--p-color-avatar-color-experimental);
31+
32+
&.imageHasLoaded {
33+
background: transparent;
34+
}
3135
}
3236

3337
@media (forced-colors: active) {

0 commit comments

Comments
 (0)