Skip to content

Commit cb9f55f

Browse files
authored
fix(ui5-avatar): wrong border-radius (#4877)
Safari applies styles of last defined slot selector. Fixes: #4873
1 parent cd5e5c8 commit cb9f55f

File tree

1 file changed

+14
-40
lines changed

1 file changed

+14
-40
lines changed

packages/main/src/themes/Avatar.css

Lines changed: 14 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,13 @@
2626
color: var(--ui5-avatar-initials-color);
2727
}
2828

29-
/* Shapes */
30-
:host([shape="Square"]),
31-
:host([shape="Square"]) ::slotted(*){
32-
border-radius: .25rem;
33-
}
34-
35-
:host([shape="Square"]) .ui5-avatar-root {
36-
border-radius: inherit;
37-
}
38-
39-
:host([shape="Square"]) .ui5-avatar-img {
40-
border-radius: inherit;
29+
.ui5-avatar-root {
30+
display: flex;
31+
align-items: center;
32+
justify-content: center;
33+
outline: none;
34+
height: 100%;
35+
width: 100%;
4136
}
4237

4338
/* Sizes */
@@ -120,6 +115,13 @@
120115
border-radius: 50%;
121116
width: 100%;
122117
height: 100%;
118+
pointer-events: none;
119+
}
120+
121+
/* Shapes */
122+
:host([shape="Square"]),
123+
:host([shape="Square"]) ::slotted(*) {
124+
border-radius: .25rem;
123125
}
124126

125127
:host(:not([color-scheme])),
@@ -195,34 +197,6 @@
195197
vertical-align: middle;
196198
}
197199

198-
:host([image-fit-type="Contain"]) .ui5-avatar-img {
199-
background-size: contain;
200-
}
201-
202-
.ui5-avatar-root {
203-
display: flex;
204-
align-items: center;
205-
justify-content: center;
206-
outline: none;
207-
}
208-
209-
.ui5-avatar-root,
210-
.ui5-avatar-img {
211-
height: 100%;
212-
width: 100%;
213-
border-radius: 50%;
214-
}
215-
216-
.ui5-avatar-img {
217-
background-repeat: no-repeat;
218-
background-position: center;
219-
background-size: cover;
220-
}
221-
222200
.ui5-avatar-initials {
223201
color: inherit;
224-
}
225-
226-
::slotted(*) {
227-
pointer-events: none;
228202
}

0 commit comments

Comments
 (0)