2021-12-28 16:32:11 +08:00
|
|
|
@mixin avatar-size($size, $fontSize) {
|
|
|
|
width: $size;
|
|
|
|
height: $size;
|
|
|
|
line-height: $size;
|
|
|
|
|
|
|
|
i {
|
|
|
|
font-size: $fontSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-22 15:27:02 +08:00
|
|
|
.#{$ns}Avatar {
|
|
|
|
background: var(--Avatar-bg);
|
2021-12-28 16:32:11 +08:00
|
|
|
@include avatar-size(var(--Avatar-size-default), var(--Avatar-icon-size-default));
|
|
|
|
position: relative;
|
2021-03-22 15:27:02 +08:00
|
|
|
display: inline-block;
|
|
|
|
overflow: hidden;
|
|
|
|
flex-shrink: 0;
|
|
|
|
border-radius: 50%;
|
|
|
|
text-align: center;
|
|
|
|
|
2021-12-28 16:32:11 +08:00
|
|
|
&--lg {
|
|
|
|
@include avatar-size(var(--Avatar-size-large), var(--Avatar-icon-size-large));
|
|
|
|
}
|
|
|
|
|
|
|
|
&--sm {
|
|
|
|
@include avatar-size(var(--Avatar-size-small), var(--Avatar-icon-size-small));
|
|
|
|
}
|
|
|
|
|
|
|
|
&--text {
|
|
|
|
position: absolute;
|
|
|
|
left: 50%;
|
|
|
|
transform-origin: 0 center;
|
|
|
|
}
|
|
|
|
|
2021-03-22 15:27:02 +08:00
|
|
|
&--square {
|
|
|
|
border-radius: 0%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--rounded {
|
|
|
|
border-radius: 10%;
|
|
|
|
}
|
|
|
|
|
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
2021-12-28 16:32:11 +08:00
|
|
|
|
2021-03-22 15:27:02 +08:00
|
|
|
img,
|
|
|
|
i {
|
|
|
|
transform: scale(1.1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|