From 9e5f08e31b4d228da011fa7cd92240433116997f Mon Sep 17 00:00:00 2001 From: Volpeon Date: Thu, 31 Mar 2022 09:51:12 +0200 Subject: Added icon nav component --- tpl/objects/icon-nav.pug | 29 +++++++++++++++++++++++++++++ tpl/objects/menu.pug | 6 ++++++ 2 files changed, 35 insertions(+) create mode 100644 tpl/objects/icon-nav.pug (limited to 'tpl/objects') diff --git a/tpl/objects/icon-nav.pug b/tpl/objects/icon-nav.pug new file mode 100644 index 0000000..6f45bf6 --- /dev/null +++ b/tpl/objects/icon-nav.pug @@ -0,0 +1,29 @@ +include icon.pug +include status-indicator.pug +include action-button.pug + +mixin icon-nav + - + let classes = { + 'o-icon-nav': true, + 'o-icon-nav--vertical': attributes.vertical, + } + if (attributes.class) { + classes[attributes.class] = true; + } + + div(class=classes)&attributes(attributes) + block + +mixin icon-nav-item(icon) + - + let classes = { + 'o-icon-nav__item': true, + 'is-selected': attributes.selected, + } + if (attributes.class) { + classes[attributes.class] = true; + } + + button(class=classes)&attributes(attributes) + +icon(icon)(block=true) diff --git a/tpl/objects/menu.pug b/tpl/objects/menu.pug index c6e8223..f9d59b8 100644 --- a/tpl/objects/menu.pug +++ b/tpl/objects/menu.pug @@ -7,6 +7,9 @@ mixin menu let classes = { 'o-menu': true, } + if (attributes.class) { + classes[attributes.class] = true; + } div(class=classes)&attributes(attributes) block @@ -17,6 +20,9 @@ mixin menu-item 'o-menu__item': true, 'is-selected': attributes.selected, } + if (attributes.class) { + classes[attributes.class] = true; + } #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) .l-card.l-card--flush.l-card--75 -- cgit v1.2.3-70-g09d2