From 7ef9d8d3fb2d3ef5bb17f146c18d5c202472d4c0 Mon Sep 17 00:00:00 2001 From: Sebastian Zoglowek <55794780+zoglo@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:44:14 +0200 Subject: [PATCH] Add badge title support (#819) --- src/components/layouts/MainLayout.vue | 68 +++++++++++++++++++++++++-- src/store/server/contao.js | 4 ++ 2 files changed, 69 insertions(+), 3 deletions(-) diff --git a/src/components/layouts/MainLayout.vue b/src/components/layouts/MainLayout.vue index d2d0773f..a5023bb3 100644 --- a/src/components/layouts/MainLayout.vue +++ b/src/components/layouts/MainLayout.vue @@ -1,7 +1,12 @@ @@ -59,6 +71,24 @@ } } + &__badge-title { + background: var(--border); + color: var(--text); + padding: 2px 5px; + position: relative; + top: -5px; + border-radius: 8px; + font-size: .75rem; + font-weight: 600; + line-height: 1; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + word-break: break-word; + overflow: hidden; + text-overflow: ellipsis; + } + &__subheader { margin: 0 0 45px; padding: 20px 0; @@ -109,6 +139,31 @@ margin: 0 20px; } + &__has-badge-title { + display: flex; + justify-content: space-between; + + .layout-main__logo { + display: flex; + } + + .layout-main__title { + display: flex; + flex-wrap: wrap; + align-items: center; + line-height: 1; + column-gap: 10px; + // Counter top positioning for row-wrap + row-gap: 5px; + } + } + + @media (max-width: 600px) { + &__badge-title { + max-width: 220px; + } + } + @include screen(700) { &__subheader-inside { flex-direction: row; @@ -120,6 +175,13 @@ } @include screen(1024) { + &__has-badge-title { + // Do not allow wrapping navigation items + .navigation__group--main { + display: flex; + } + } + &__subheader-inside, &__content, footer { diff --git a/src/store/server/contao.js b/src/store/server/contao.js index 52fbca94..6556b1fe 100644 --- a/src/store/server/contao.js +++ b/src/store/server/contao.js @@ -12,6 +12,10 @@ export default { contaoConfig: null, }, + getters: { + badgeTitle: state => state.contaoConfig?.backend?.badge_title, + }, + mutations: { setCache(state, response) { state.cache = response;