From 3aa12ffd79e2b99d0786770ff7183e3b7bb041fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20A=C3=ADsa?= Date: Fri, 31 May 2024 19:43:54 +0200 Subject: [PATCH 1/9] Add navigator-title slot to NavigatorCard --- src/components/Navigator/NavigatorCard.vue | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/components/Navigator/NavigatorCard.vue b/src/components/Navigator/NavigatorCard.vue index e3a0d2a82..ce77703fe 100644 --- a/src/components/Navigator/NavigatorCard.vue +++ b/src/components/Navigator/NavigatorCard.vue @@ -32,18 +32,20 @@ @keydown.up.exact.capture.prevent="focusPrev" @keydown.down.exact.capture.prevent="focusNext" > - - - - + + + + + + Date: Fri, 31 May 2024 19:45:58 +0200 Subject: [PATCH 2/9] Negative margin to bring the filter up while keeping the height and padding as it is --- src/components/Navigator/NavigatorCard.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Navigator/NavigatorCard.vue b/src/components/Navigator/NavigatorCard.vue index ce77703fe..dc30a22fe 100644 --- a/src/components/Navigator/NavigatorCard.vue +++ b/src/components/Navigator/NavigatorCard.vue @@ -1056,6 +1056,9 @@ $navigator-card-vertical-spacing: 8px !default; align-items: flex-end; .filter-on-top & { + // negative margin to bring the filter up + // while keeping the height and padding as it is + margin-top: calc(#{var(--nav-filter-vertical-padding)} * -1); border-top: none; align-items: flex-start; } @@ -1065,9 +1068,10 @@ $navigator-card-vertical-spacing: 8px !default; @include breakpoint(medium, nav) { --nav-filter-horizontal-padding: 20px; + --nav-filter-vertical-padding: 10px; border: none; - padding-top: 10px; - padding-bottom: 10px; + padding-top: var(--nav-filter-vertical-padding); + padding-bottom: var(--nav-filter-vertical-padding); height: $filter-height-small; } @@ -1095,6 +1099,7 @@ $navigator-card-vertical-spacing: 8px !default; .scroller { height: 100%; + margin: 0; box-sizing: border-box; padding-bottom: calc(var(--top-offset, 0px) + var(--card-vertical-spacing)); transition: padding-bottom ease-in 0.15s; From 0c3853cd19906808c32d5a8eab995fa953985e91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20A=C3=ADsa?= Date: Mon, 3 Jun 2024 14:02:48 +0200 Subject: [PATCH 3/9] Add test --- tests/unit/components/Navigator/NavigatorCard.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/unit/components/Navigator/NavigatorCard.spec.js b/tests/unit/components/Navigator/NavigatorCard.spec.js index 8f817a1d7..9cd61b4c9 100644 --- a/tests/unit/components/Navigator/NavigatorCard.spec.js +++ b/tests/unit/components/Navigator/NavigatorCard.spec.js @@ -320,6 +320,15 @@ describe('NavigatorCard', () => { expect(wrapper.find('.post-head').text()).toBe('CustomPostHead'); }); + it('exposes a #navigator-title slot', () => { + const wrapper = createWrapper({ + scopedSlots: { + 'navigator-title': '', + }, + }); + expect(wrapper.find('.navigator-title').text()).toBe('CustomNavigatorTitle'); + }); + it('exposes a #above-navigator-head slot', () => { const wrapper = createWrapper({ scopedSlots: { From f1e3b9b304235c79b222e46040236b19eab6efaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marina=20A=C3=ADsa?= Date: Tue, 4 Jun 2024 19:24:24 +0200 Subject: [PATCH 4/9] Refactor styles for navigator-title --- src/components/Navigator/NavigatorCard.vue | 32 ++++++++++++++-------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/components/Navigator/NavigatorCard.vue b/src/components/Navigator/NavigatorCard.vue index dc30a22fe..8be3d1c10 100644 --- a/src/components/Navigator/NavigatorCard.vue +++ b/src/components/Navigator/NavigatorCard.vue @@ -32,12 +32,15 @@ @keydown.up.exact.capture.prevent="focusPrev" @keydown.down.exact.capture.prevent="focusNext" > - +