summaryrefslogtreecommitdiffstats
path: root/tpl/objects
diff options
context:
space:
mode:
Diffstat (limited to 'tpl/objects')
-rw-r--r--tpl/objects/card.pug29
-rw-r--r--tpl/objects/table.pug2
2 files changed, 30 insertions, 1 deletions
diff --git a/tpl/objects/card.pug b/tpl/objects/card.pug
new file mode 100644
index 0000000..d6516be
--- /dev/null
+++ b/tpl/objects/card.pug
@@ -0,0 +1,29 @@
1mixin card
2 - const slots = {}
3
4 mixin slot(key)
5 - slots[key] = block
6
7 -
8 block ? block() : undefined
9
10 let classes = {
11 'o-card': true,
12 }
13
14 if attributes.href
15 a(href=attributes.href class=classes)
16 if slots.body
17 .o-card__body
18 - slots.body()
19 if slots.footer
20 .o-card__footer
21 - slots.footer()
22 else
23 div(class=classes)
24 if slots.body
25 .o-card__body
26 - slots.body()
27 if slots.footer
28 .o-card__footer
29 - slots.footer()
diff --git a/tpl/objects/table.pug b/tpl/objects/table.pug
index e635589..c8ff17e 100644
--- a/tpl/objects/table.pug
+++ b/tpl/objects/table.pug
@@ -5,7 +5,7 @@ mixin table
5 'o-table--flush': attributes.flush, 5 'o-table--flush': attributes.flush,
6 'o-table--box': attributes.box, 6 'o-table--box': attributes.box,
7 'o-table--interactive': attributes.interactive, 7 'o-table--interactive': attributes.interactive,
8 'o-table--50': attributes.size50, 8 'o-table--sm': attributes.sm,
9 } 9 }
10 10
11 table(class=classes) 11 table(class=classes)