UX: Fix width on avatar flair.

This commit is contained in:
Guo Xiang Tan 2016-12-22 14:30:49 +08:00
parent 8551d821a0
commit 6955c39c68
2 changed files with 13 additions and 4 deletions

View File

@ -13,7 +13,13 @@ createWidget('avatar-flair', {
},
buildClasses(attrs) {
return 'avatar-flair-' + attrs.primary_group_name + (attrs.primary_group_flair_bg_color ? ' rounded' : '');
let defaultClass = `avatar-flair-${attrs.primary_group_name} ${(attrs.primary_group_flair_bg_color ? 'rounded' : '')}`;
if (!this.isIcon(attrs)) {
defaultClass += ' avatar-flair-image';
}
return defaultClass;
},
buildAttributes(attrs) {

View File

@ -23,12 +23,15 @@
vertical-align: middle;
}
.avatar-flair {
$size: 50px;
$size: 50px;
.avatar-flair-image {
width: $size;
}
.avatar-flair {
background-size: $size;
height: $size;
width: $size;
i {
font-size: $size !important;