From a08dee14bcc07ee31175265cb586e857d44fb12e Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sun, 27 Mar 2022 18:52:27 +0200 Subject: Improved bubbles --- tpl/objects/bubble.pug | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'tpl/objects/bubble.pug') diff --git a/tpl/objects/bubble.pug b/tpl/objects/bubble.pug index a79f119..681661c 100644 --- a/tpl/objects/bubble.pug +++ b/tpl/objects/bubble.pug @@ -1,21 +1,36 @@ -mixin bubble(time, user) +mixin bubble(user) + - const slots = {} + + mixin slot(key) + - slots[key] = block + - + block ? block() : undefined + let classes = { - 'o-bubble': true, - 't-raised': true + 'o-bubble': true, + 'o-bubble--compact': attributes.compact, + 't-raised': !attributes.theme } if (attributes.class) { classes[attributes.class] = true } + if (attributes.theme) { + classes[attributes.theme] = true + } article(class=classes) - if user - header.o-bubble__user + if slots.header + header.o-bubble__header + - slots.header() + else if user + header.o-bubble__header strong= user - span.s-colored-links - block - small.o-bubble__time - = time - if attributes.scope - = ' ' - +icon(attributes.scope) + div.o-bubble__body.s-colored-links + - slots.body() + if slots.time + small.o-bubble__time + - slots.time() + if slots.footer + footer.o-bubble__footer + - slots.footer() -- cgit v1.2.3-70-g09d2