From 2085e99bcde12027a2bc0479d95e7511acfb4562 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 11 Nov 2025 21:00:31 +0100 Subject: Fixed and improved nav bar to support labels --- tpl/objects/navbar.pug | 12 +++++++++--- tpl/views/navbar.pug | 8 +++++++- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'tpl') diff --git a/tpl/objects/navbar.pug b/tpl/objects/navbar.pug index 14ec9d3..28c7107 100644 --- a/tpl/objects/navbar.pug +++ b/tpl/objects/navbar.pug @@ -26,12 +26,18 @@ mixin navbar-item } #{!!attributes.tag ? attributes.tag : 'button'}(class=classes)&attributes(attributes) + if attributes.icon + .o-navbar__item-label + block .o-navbar__item-content + if attributes.preIcon + +icon(attributes.preIcon) + = ' ' if attributes.icon +icon(attributes.icon) - = ' ' - span.o-navbar__item-content-text - block + else + span.o-navbar__item-content-text + block if attributes.postIcon = ' ' +icon(attributes.postIcon) diff --git a/tpl/views/navbar.pug b/tpl/views/navbar.pug index 345a22b..f409a44 100644 --- a/tpl/views/navbar.pug +++ b/tpl/views/navbar.pug @@ -14,6 +14,12 @@ mixin view-navbar .c-box +navbar(quiet=true) - +navbar-item(selected=true icon="arrow-left")= 'Home' + +navbar-item(selected=true preIcon="arrow-left")= 'Home' +navbar-item= 'Art' +navbar-item= 'Emojis' + + .c-box + +navbar + +navbar-item(icon="image")= 'Home' + +navbar-item(icon="video" selected=true)= 'Art' + +navbar-item(icon="user")= 'Emojis' -- cgit v1.2.3-70-g09d2