From ac04c0bb55f51dd18daaf6813c47a0db8525180f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 28 Jan 2023 09:34:19 +0100 Subject: Added overflow button --- tpl/objects/action-button.pug | 4 +--- tpl/objects/overflow-button.pug | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 tpl/objects/overflow-button.pug (limited to 'tpl/objects') diff --git a/tpl/objects/action-button.pug b/tpl/objects/action-button.pug index f99d789..e11e4a5 100644 --- a/tpl/objects/action-button.pug +++ b/tpl/objects/action-button.pug @@ -19,6 +19,4 @@ mixin action-button if attributes.icon +icon(attributes.icon)(block=!block) = ' ' - if block - span.o-action-button__label - block + block diff --git a/tpl/objects/overflow-button.pug b/tpl/objects/overflow-button.pug new file mode 100644 index 0000000..f52f12b --- /dev/null +++ b/tpl/objects/overflow-button.pug @@ -0,0 +1,22 @@ +include icon.pug + +mixin overflow-button + - + let classes = { + 'o-overflow-button': true, + 'u-d-block': attributes.block, + 'is-selected': attributes.selected + } + if (attributes.class) { + classes[attributes.class] = true; + } + + let href = attributes.disabled ? null : '#'; + + a(class=classes href=href) + .o-overflow-button__inside + if attributes.icon + +icon(attributes.icon)(block=!block) + = ' ' + .o-overflow-button__outside + block -- cgit v1.2.3-70-g09d2