summaryrefslogtreecommitdiffstats
path: root/tpl/objects/action-button.pug
blob: f99d789dbc6795810b123851b692e322c36612ee (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
include icon.pug

mixin action-button
    -
        let classes = {
            'o-action-button':        true,
            'u-d-block':              attributes.block,
            'o-action-button--quiet': attributes.quiet,
            'o-action-button--round': attributes.round,
            'is-selected':            attributes.selected
        }
        if (attributes.class) {
            classes[attributes.class] = true;
        }

        let href = attributes.disabled ? null : '#';

    a(class=classes href=href)
        if attributes.icon
            +icon(attributes.icon)(block=!block)
            = ' '
        if block
            span.o-action-button__label
                block