ant-design/components/avatar/style/index.less

62 lines
1.0 KiB
Plaintext
Raw Normal View History

2017-05-28 14:20:59 +08:00
@import "../../style/themes/default";
@import "../../style/mixins/index";
2017-05-28 14:20:59 +08:00
@avatar-prefix-cls: ~"@{ant-prefix}-avatar";
.@{avatar-prefix-cls} {
.reset-component;
2017-05-28 14:20:59 +08:00
display: inline-block;
text-align: center;
background: @avatar-bg;
color: @avatar-color;
2017-06-07 11:18:31 +08:00
white-space: nowrap;
position: relative;
2017-05-28 14:20:59 +08:00
overflow: hidden;
2018-01-23 21:02:50 +08:00
vertical-align: middle;
&-image {
background: transparent;
}
2017-05-28 14:20:59 +08:00
.avatar-size(@avatar-size-base, @avatar-font-size-base);
&-lg {
.avatar-size(@avatar-size-lg, @avatar-font-size-lg);
}
&-sm {
.avatar-size(@avatar-size-sm, @avatar-font-size-sm);
}
&-square {
border-radius: @avatar-border-radius;
}
& > img {
width: 100%;
height: 100%;
2017-10-18 19:41:44 +08:00
display: block;
2017-05-28 14:20:59 +08:00
}
}
.avatar-size(@size, @font-size) {
width: @size;
height: @size;
line-height: @size;
border-radius: 50%;
2017-05-28 14:20:59 +08:00
& > * {
line-height: @size;
}
&-string {
position: absolute;
left: 50%;
transform-origin: 0 center;
}
2017-05-28 14:20:59 +08:00
&.@{avatar-prefix-cls}-icon {
font-size: @font-size;
}
}