summaryrefslogtreecommitdiffstats
path: root/tpl/objects/avatar.pug
blob: 83c0f7c720db8b337a2edca5b4bd8fcee570406a (plain) (blame)
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
include ../objects/status-indicator.pug

mixin avatar
    -
        let classes = {
            'o-avatar':         true,
            'o-avatar--circle': attributes.circle
        }

        if (attributes.size) {
            classes['o-avatar--' + attributes.size] = true;
        }

        let styles = {}
        if (attributes.hue) {
            styles['--avatar--colors--h'] = attributes.hue;
        }

    div(class=classes style=styles)
        if attributes.status 
            +status-indicator(attributes.status)(class='o-avatar__status')
        if attributes.src 
            img.o-avatar__content(src=attributes.src)
        else
            .o-avatar__content
                block