summaryrefslogtreecommitdiffstats
path: root/tpl/objects/button.pug
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/objects/button.pug')
-rw-r--r--tpl/objects/button.pug26
1 files changed, 17 insertions, 9 deletions
diff --git a/tpl/objects/button.pug b/tpl/objects/button.pug
index 0884c8d..c356bfe 100644
--- a/tpl/objects/button.pug
+++ b/tpl/objects/button.pug
@@ -1,22 +1,30 @@
1mixin a-button 1include icon.pug
2
3mixin button
2 - 4 -
3 let classes = { 5 let classes = {
4 'o-button': true, 6 'o-button': true,
5 'o-button--block': attributes.block, 7 'u-d-block': attributes.block,
6 'o-button--primary': attributes.primary, 8 'o-button--secondary': attributes.secondary,
7 'o-button--outline': attributes.outline, 9 'o-button--quiet': attributes.quiet,
8 'o-button--round': !!attributes.icon && !block 10 'o-button--pill': attributes.pill,
11 'o-button--badge': attributes.badge,
12 'o-button--icon': !!attributes.icon && !block,
13 'is-selected': attributes.selected,
9 } 14 }
10 if (attributes.variant) { 15 if (attributes.theme) {
11 classes['o-button--' + attributes.variant] = true 16 classes['o-button--' + attributes.theme] = true
12 } 17 }
13 if (attributes.size) { 18 if (attributes.size) {
14 classes['o-button--' + attributes.size] = true 19 classes['o-button--' + attributes.size] = true
15 } 20 }
21 if (attributes.class) {
22 classes[attributes.class] = true;
23 }
16 24
17 let href = attributes.disabled ? null : '#'; 25 let href = attributes.disabled ? null : '#';
18 26
19 a(class=classes href=href aria-disabled=attributes.disabled && String(attributes.disabled)) 27 a(class=classes href=href)
20 if attributes.icon 28 if attributes.icon
21 +icon(attributes.icon) 29 +icon(attributes.icon)
22 = ' ' 30 = ' '