feat: Support square variants of thumbnail and avatar components (#5003)

This commit is contained in:
Fayaz Ahmed 2022-07-09 14:03:55 +05:30 committed by GitHub
parent 43f46e96d4
commit b9eb9a5e48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 2 deletions

View file

@ -40,13 +40,18 @@ export default {
type: Boolean,
default: true,
},
variant: {
type: String,
default: 'circle',
},
},
computed: {
style() {
let style = {
width: `${this.size}px`,
height: `${this.size}px`,
borderRadius: this.rounded ? '50%' : 0,
borderRadius:
this.variant === 'square' ? 'var(--border-radius-large)' : '50%',
lineHeight: `${this.size + Math.floor(this.size / 20)}px`,
fontSize: `${Math.floor(this.size / 2.5)}px`,
};