From b44b66f020f1f11a8e4b0fc630fcee84b3446cad Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Tue, 5 Sep 2023 10:56:51 +0200 Subject: [PATCH 1/2] EventSourceBadge: Streamline markup --- library/Notifications/Widget/EventSourceBadge.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/library/Notifications/Widget/EventSourceBadge.php b/library/Notifications/Widget/EventSourceBadge.php index 9e8eb666d..b6647e68a 100644 --- a/library/Notifications/Widget/EventSourceBadge.php +++ b/library/Notifications/Widget/EventSourceBadge.php @@ -39,7 +39,9 @@ protected function assemble() ->getAttributes() ->add('title', $title); - $this->add((new SourceIcon(SourceIcon::SIZE_LARGE))->addHtml($this->source->getIcon())); - $this->add(Html::tag('span', ['class' => 'name'], $this->source->name ?? $this->source->type)); + $this->add([ + (new SourceIcon(SourceIcon::SIZE_LARGE))->addHtml($this->source->getIcon()), + ($this->source->name ?? $this->source->type) + ]); } } From 98029c2ed4a16a3bab0766db2013378efebd7b3b Mon Sep 17 00:00:00 2001 From: Florian Strohmaier Date: Tue, 5 Sep 2023 10:57:17 +0200 Subject: [PATCH 2/2] css: Increase icon size and alignment --- public/css/common.less | 3 ++- public/css/event-source-badge.less | 23 +++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/public/css/common.less b/public/css/common.less index b9fa4e103..307b77991 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -33,8 +33,9 @@ color: @text-color; margin-right: 0.2em; + i.icon { - vertical-align: text-top; + font-size: 1.25em; } i.icon:before { diff --git a/public/css/event-source-badge.less b/public/css/event-source-badge.less index 513347a81..ce8a2540c 100644 --- a/public/css/event-source-badge.less +++ b/public/css/event-source-badge.less @@ -1,21 +1,12 @@ .event-source-badge { - position: relative; + display: inline-flex; + background: @gray; + border-radius: 1em; + padding-right: .5em; + line-height: 2em; + color: @text-color-inverted; .source-icon { - position: absolute; - } - - .name { - position: relative; - display: inline-block; - height: 2em; - border-bottom-right-radius: 1em; - border-top-right-radius: 1em; - z-index: -99; - padding: @ball-pad .5em @ball-pad 1.5em; - margin-left: 1em; - - background-color: @gray; - color: @text-color-inverted; + padding: 0 } }