_avatar.scss
2.73 KB
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
// BAvatar custom styles
.b-avatar {
display: inline-flex;
align-items: center;
justify-content: center;
vertical-align: middle;
flex-shrink: 0;
width: $b-avatar-size;
height: $b-avatar-size;
font-size: inherit;
font-weight: 400;
line-height: 1;
max-width: 100%;
max-height: auto;
text-align: center;
overflow: visible;
position: relative;
transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
box-shadow 0.15s ease-in-out;
&:focus {
outline: 0;
}
&.btn,
&[href] {
padding: 0;
border: 0;
.b-avatar-img img {
transition: transform 0.15s ease-in-out;
}
&:not(:disabled):not(.disabled) {
cursor: if($enable-pointer-cursor-for-buttons, pointer, null);
&:hover {
.b-avatar-img img {
transform: scale(1.15);
}
}
}
}
&.disabled,
&:disabled,
&[disabled] {
opacity: $btn-disabled-opacity;
pointer-events: none;
}
.b-avatar-custom,
.b-avatar-text,
.b-avatar-img {
border-radius: inherit;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
// https://gist.github.com/ayamflow/b602ab436ac9f05660d9c15190f4fd7b
mask-image: radial-gradient(white, black);
}
.b-avatar-text {
text-transform: uppercase;
white-space: nowrap;
}
&[href] {
text-decoration: none;
}
> .b-icon {
width: 60%;
height: auto;
max-width: 100%;
}
.b-avatar-img img {
width: 100%;
height: 100%;
max-height: auto;
border-radius: inherit;
// This is not supported in IE11 and Edge <16
// https://caniuse.com/object-fit
object-fit: cover;
}
.b-avatar-badge {
// Positioning will be handled via inline styles
position: absolute;
min-height: 1.5em;
min-width: 1.5em;
padding: 0.25em;
line-height: 1;
border-radius: 10em;
font-size: 70%;
font-weight: 700;
z-index: 1;
}
}
.b-avatar-sm {
width: $b-avatar-size-sm;
height: $b-avatar-size-sm;
.b-avatar-text {
font-size: calc(#{$b-avatar-size-sm * $b-avatar-font-size-scale});
}
.b-avatar-badge {
font-size: calc(#{$b-avatar-size-sm * $b-avatar-badge-font-size-scale});
}
}
.b-avatar-lg {
width: $b-avatar-size-lg;
height: $b-avatar-size-lg;
.b-avatar-text {
font-size: calc(#{$b-avatar-size-lg * $b-avatar-font-size-scale});
}
.b-avatar-badge {
font-size: calc(#{$b-avatar-size-lg * $b-avatar-badge-font-size-scale});
}
}
.b-avatar-group {
.b-avatar-group-inner {
display: flex;
flex-wrap: wrap;
}
.b-avatar {
border: $border-width solid $border-color;
}
a,
.btn {
&.b-avatar:hover:not(.disabled):not(disabled) {
z-index: 1;
}
}
}