-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
avatar-stack.scss
149 lines (124 loc) · 2.83 KB
/
avatar-stack.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// Stacked avatars can be used to show who is participating in thread when
// there is limited space available.
.AvatarStack {
position: relative;
min-width: 26px;
height: 20px;
.AvatarStack-body {
position: absolute;
}
&.AvatarStack--two {
min-width: 36px;
}
&.AvatarStack--three-plus {
min-width: 46px;
}
}
.AvatarStack-body {
display: flex;
background: var(--color-canvas-default);
// stylelint-disable-next-line primer/borders
border-radius: 100px;
.avatar {
position: relative;
z-index: 2;
display: flex;
width: 20px;
height: 20px;
box-sizing: content-box;
// stylelint-disable-next-line primer/spacing
margin-right: -11px;
background-color: var(--color-canvas-default);
border-right: $border-width $border-style var(--color-canvas-default);
// stylelint-disable-next-line primer/borders
border-radius: $border-radius-1;
box-shadow: none;
transition: margin 0.1s ease-in-out;
&:first-child {
z-index: 3;
}
&:last-child {
z-index: 1;
border-right: 0;
}
// stylelint-disable selector-max-type
img {
// stylelint-disable-next-line primer/borders
border-radius: $border-radius-1;
}
// stylelint-enable selector-max-type
// Account for 4+ avatars
&:nth-child(n + 4) {
display: none;
opacity: 0;
}
}
&:hover {
.avatar {
// stylelint-disable-next-line primer/spacing
margin-right: 3px;
}
.avatar:nth-child(n + 4) {
display: flex;
opacity: 1;
}
.avatar-more {
display: none !important;
}
}
}
.avatar.avatar-more {
z-index: 1;
margin-right: 0;
background: var(--color-canvas-subtle);
&::before,
&::after {
position: absolute;
display: block;
height: 20px;
content: '';
// stylelint-disable-next-line primer/borders
border-radius: 2px;
outline: $border-width $border-style var(--color-canvas-default);
}
&::before {
width: 17px;
background: var(--color-avatar-stack-fade-more);
}
&::after {
width: 14px;
background: var(--color-avatar-stack-fade);
}
}
// Right aligned variation
.AvatarStack--right {
.AvatarStack-body {
right: 0;
flex-direction: row-reverse;
&:hover .avatar {
margin-right: 0;
// stylelint-disable-next-line primer/spacing
margin-left: 3px;
}
.avatar:not(:last-child) {
border-left: 0;
}
}
.avatar.avatar-more {
background: var(--color-avatar-stack-fade);
&::before {
width: 5px;
}
&::after {
width: 2px;
background: var(--color-canvas-subtle);
}
}
.avatar {
margin-right: 0;
// stylelint-disable-next-line primer/spacing
margin-left: -11px;
border-right: 0;
border-left: $border-width $border-style var(--color-canvas-default);
}
}