diff options
Diffstat (limited to 'tpl/objects')
-rw-r--r-- | tpl/objects/button.pug | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/tpl/objects/button.pug b/tpl/objects/button.pug index b9b4cbd..c356bfe 100644 --- a/tpl/objects/button.pug +++ b/tpl/objects/button.pug | |||
@@ -4,13 +4,13 @@ mixin button | |||
4 | - | 4 | - |
5 | let classes = { | 5 | let classes = { |
6 | 'o-button': true, | 6 | 'o-button': true, |
7 | 'u-d-block': attributes.block, | 7 | 'u-d-block': attributes.block, |
8 | 'o-button--secondary': attributes.secondary, | 8 | 'o-button--secondary': attributes.secondary, |
9 | 'o-button--quiet': attributes.quiet, | 9 | 'o-button--quiet': attributes.quiet, |
10 | 'o-button--pill': attributes.pill, | 10 | 'o-button--pill': attributes.pill, |
11 | 'o-button--static': attributes.static, | 11 | 'o-button--badge': attributes.badge, |
12 | 'o-button--icon': !!attributes.icon && !block, | 12 | 'o-button--icon': !!attributes.icon && !block, |
13 | 'is-selected': attributes.selected, | 13 | 'is-selected': attributes.selected, |
14 | } | 14 | } |
15 | if (attributes.theme) { | 15 | if (attributes.theme) { |
16 | classes['o-button--' + attributes.theme] = true | 16 | classes['o-button--' + attributes.theme] = true |
@@ -24,25 +24,13 @@ mixin button | |||
24 | 24 | ||
25 | let href = attributes.disabled ? null : '#'; | 25 | let href = attributes.disabled ? null : '#'; |
26 | 26 | ||
27 | if attributes.badge | 27 | a(class=classes href=href) |
28 | span(class=classes href=href) | 28 | if attributes.icon |
29 | if attributes.icon | 29 | +icon(attributes.icon) |
30 | +icon(attributes.icon) | 30 | = ' ' |
31 | = ' ' | 31 | if block |
32 | if block | 32 | span.o-button__label |
33 | span.o-button__label | 33 | block |
34 | block | 34 | if attributes.postIcon |
35 | if attributes.postIcon | 35 | = ' ' |
36 | = ' ' | 36 | +icon(attributes.postIcon) |
37 | +icon(attributes.postIcon) | ||
38 | else | ||
39 | a(class=classes href=href) | ||
40 | if attributes.icon | ||
41 | +icon(attributes.icon) | ||
42 | = ' ' | ||
43 | if block | ||
44 | span.o-button__label | ||
45 | block | ||
46 | if attributes.postIcon | ||
47 | = ' ' | ||
48 | +icon(attributes.postIcon) | ||