naive-ui/styles/Avatar.scss

54 lines
1.2 KiB
SCSS
Raw Normal View History

@import './mixins/mixins.scss';
@mixin avatar-size-mixin($size) {
@include m($size + '-size') {
$width: map-get($--n-height, $size);
width: $width;
height: $width;
@include m(circle-shaped, round-shaped) {
border-radius: $width / 2;
}
@include e(text) {
line-height: 1.25;
}
2019-11-22 13:21:32 +08:00
@include b(icon) {
2019-11-22 13:27:49 +08:00
font-size: $width;
2019-11-22 13:21:32 +08:00
}
}
}
@include themes-mixin {
@include b(avatar) {
2019-11-28 14:03:12 +08:00
@include once {
@include avatar-size-mixin('small');
@include avatar-size-mixin('medium');
@include avatar-size-mixin('large');
@include b(icon) {
fill: white;
2020-02-07 20:04:20 +08:00
stroke: white;
2019-11-28 14:03:12 +08:00
vertical-align: bottom;
}
color: white;
transition: background-color .3s $--n-ease-in-out-cubic-bezier, color .3s $--n-ease-in-out-cubic-bezier;
2019-11-28 14:03:12 +08:00
font-size: 14px;
display: inline-block;
2019-11-28 14:03:12 +08:00
position: relative;
2020-02-28 22:57:10 +08:00
border-radius: $--n-avatar-border-radius;
2019-11-28 14:03:12 +08:00
overflow: hidden;
text-align: center;
img {
width: 100%;
height: 100%;
}
@include e(text) {
white-space: nowrap;
display: inline-block;
position: absolute;
left: 50%;
top: 50%;
}
}
2019-11-28 14:03:12 +08:00
background-color: $--avatar-background-color;
}
}