Skip to content

Commit ea17b26

Browse files
authored
feat: add group avatar styles (#319)
1 parent 8fed4e0 commit ea17b26

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

src/v2/styles/Avatar/Avatar-layout.scss

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,51 @@
8787
width: calc(var(--str-chat__spacing-px) * 49);
8888
height: calc(var(--str-chat__spacing-px) * 49);
8989
}
90+
91+
92+
.str-chat__avatar-group {
93+
display: grid;
94+
grid-template-columns: repeat(2, 1fr);
95+
grid-template-rows: repeat(2, 1fr);
96+
height: var(--str-chat__avatar-size);
97+
line-height: var(--str-chat__avatar-size);
98+
width: var(--str-chat__avatar-size);
99+
min-width: var(--str-chat__avatar-size);
100+
overflow: hidden;
101+
102+
&.str-chat__avatar-group--three-part {
103+
.str-chat__avatar:nth-child(1) {
104+
grid-area: 1 / 1 / 3 / 2;
105+
}
106+
107+
.str-chat__avatar:nth-child(2) {
108+
grid-area: 1 / 2 / 2 / 3;
109+
}
110+
111+
.str-chat__avatar:nth-child(3) {
112+
grid-area: 2 / 2 / 3 / 3;
113+
}
114+
}
115+
116+
.str-chat__avatar {
117+
height: 100%;
118+
line-height: 100%;
119+
width: 100%;
120+
min-width: 100%;
121+
122+
.str-chat__avatar-fallback, img {
123+
border-radius: 0;
124+
}
125+
126+
&.str-chat__avatar--single .str-chat__avatar-fallback {
127+
display: flex;
128+
align-items: center;
129+
justify-content: center;
130+
font-size: calc(var(--str-chat__avatar-size) * 0.5);
131+
}
132+
133+
.str-chat__avatar-fallback {
134+
font-size: calc(var(--str-chat__avatar-size) * 0.33);
135+
}
136+
}
137+
}

src/v2/styles/Avatar/Avatar-theme.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,8 @@
5757
.str-chat__loading-channels-avatar {
5858
border-radius: var(--str-chat__avatar-border-radius);
5959
}
60+
61+
62+
.str-chat__avatar-group {
63+
border-radius: var(--str-chat__avatar-border-radius);
64+
}

0 commit comments

Comments
 (0)