All files / src/components/u-avatar.vue index.vue

68.42% Statements 13/19
33.33% Branches 2/6
33.33% Functions 1/3
72.22% Lines 13/18

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80      7x     7x             7x           7x 7x             7x 7x 7x 7x 7x 7x 7x           7x                                                                                
<template>
<div :class="$style.root">
    <slot></slot>
</div>
</template>
 
<script>
export default { name: 'u-avatar' };
</script>
 
<style module>
.root {
    display: inline-block;
    background: #c1c7d0 url('./assets/avatar.png');
    background-size: 100%;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    overflow: hidden;
    vertical-align: middle;
    margin-bottom: 2px;
}

.root > img {
    max-width: 100%;
}
 
.root[shape="circle"] { /* By default */ }
 
.root[shape="square"] {
    border-radius: 0;
}
 
.root[size="mini"] {
    width: var(--avatar-size-mini);
    height: var(--avatar-size-mini);
}
 
.root[size="small"] {
    width: var(--avatar-size-small);
    height: var(--avatar-size-small);
}
 
.root[size="normal"] { /* By default */ }
 
.root[size="large"] {
    width: var(--avatar-size-large);
    height: var(--avatar-size-large);
}
 
.root[size="huge"] {
    width: var(--avatar-size-huge);
    height: var(--avatar-size-huge);
}
 
.root[type="1"] {
    background-image: url('./assets/avatar-1.png');
}
 
.root[type="2"] {
    background-image: url('./assets/avatar-2.png');
}
 
.root[type="3"] {
    background-image: url('./assets/avatar-3.png');
}
 
.root[type="4"] {
    background-image: url('./assets/avatar-4.png');
}
 
.root[type="5"] {
    background-image: url('./assets/avatar-5.png');
}
 
.root[type="6"] {
    background-image: url('./assets/avatar-6.png');
}
</style>