update Avatar

This commit is contained in:
梁灏 2017-08-15 11:03:20 +08:00
parent c5a721ade8
commit a1530fac5a
4 changed files with 116 additions and 7 deletions

View file

@ -1,5 +1,45 @@
@avatar-prefix-cls: ~"@{css-prefix}avatar";
.@{avatar-prefix-cls} {
display: inline-block;
text-align: center;
background: @avatar-bg;
color: @avatar-color;
white-space: nowrap;
position: relative;
overflow: hidden;
}
.avatar-size(@avatar-size-base, @avatar-font-size-base);
&-large {
.avatar-size(@avatar-size-lg, @avatar-font-size-lg);
}
&-small {
.avatar-size(@avatar-size-sm, @avatar-font-size-sm);
}
&-square {
border-radius: @avatar-border-radius;
}
& > img {
width: 100%;
height: 100%;
}
}
.avatar-size(@size, @font-size) {
width: @size;
height: @size;
line-height: @size;
border-radius: @size / 2;
& > * {
line-height: @size;
}
&.@{avatar-prefix-cls}-icon {
font-size: @font-size;
}
}

View file

@ -161,4 +161,15 @@
@slider-margin : 16px 0;
@slider-button-wrap-size : 18px;
@slider-button-wrap-offset : -4px;
@slider-disabled-color : #ccc;
@slider-disabled-color : #ccc;
// Avatar
@avatar-size-base: 32px;
@avatar-size-lg: 40px;
@avatar-size-sm: 24px;
@avatar-font-size-base: 18px;
@avatar-font-size-lg: 24px;
@avatar-font-size-sm: 14px;
@avatar-bg: #ccc;
@avatar-color: #fff;
@avatar-border-radius: @border-radius-small;