summaryrefslogtreecommitdiffstats
path: root/tpl/objects/badge.pug
blob: 04fd8eb8264a5fa3ba636910b38664266ddf3a09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
mixin badge(variant)
    -
        let classes = {
            'o-badge':       true,
            'o-badge--pill': !!attributes.pill,
            'o-menu__badge': !!attributes.menu,
        }
        if (attributes.size) {
            classes['o-badge--' + attributes.size] = true
        }
        if (variant) {
            classes['o-badge--' + variant] = true
        }

    if attributes.href
        a(href=attributes.href class=classes)
            block
    else
        span(class=classes)
            block