Skip to content

Commit 2eea44e

Browse files
committed
Sidebar: Make mobile sidebar full length
1 parent b7cad43 commit 2eea44e

File tree

6 files changed

+37
-119
lines changed

6 files changed

+37
-119
lines changed

assets/css/v2/style.css

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ ol li:last-child {
441441
}
442442

443443
.header__search {
444+
display: block;
444445
width: 14rem;
445446
/* This is a horrible hack to stop coveo overflowing 3500px for no reason. :sad */
446447
transform: translateY(0);
@@ -635,16 +636,20 @@ ol li:last-child {
635636
display: block;
636637
transform: translateX(0);
637638
border-bottom: 1px solid oklch(var(--color-divider));
638-
height: fit-content;
639+
639640
position: fixed;
640641
top: 0;
641642
left: 0;
642643

643-
.sidebar__search {
644+
.sidebar__content__wrapper {
644645
display: flex;
646+
flex-direction: column;
647+
}
648+
649+
.sidebar__search {
650+
display: unset;
645651
width: calc(var(--sidebar-width) - 4rem);
646-
justify-self: anchor-center;
647-
margin-left: -1rem;
652+
margin-left: 1rem;
648653
}
649654
}
650655
}

assets/js/site-dropdown.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
document.addEventListener('DOMContentLoaded', () => {
22
const dropdownContent = document.getElementById('dropdown-content');
33
const navbarButton = document.getElementById('navbar-sites-button');
4+
const chevronIcon = document.getElementById('navbar-sites-button-icon');
45

56
navbarButton.addEventListener('click', () => {
7+
chevronIcon.classList.toggle('rotate-chevron');
8+
69
if (dropdownContent.style.display === 'block') {
710
dropdownContent.style.display = 'none';
11+
navbarButton.classList.remove('remove-bottom-radius');
812
} else {
913
dropdownContent.style.display = 'block';
14+
navbarButton.classList.add('remove-bottom-radius');
1015
}
1116
});
1217

@@ -15,7 +20,14 @@ document.addEventListener('DOMContentLoaded', () => {
1520
!event.target.matches('#navbar-sites-button') &&
1621
!event.target.matches('#navbar-sites-button-icon')
1722
) {
23+
if (
24+
dropdownContent.style.display !== 'none' &&
25+
dropdownContent.style.display !== ''
26+
) {
27+
chevronIcon.classList.toggle('rotate-chevron');
28+
}
1829
dropdownContent.style.display = 'none';
30+
navbarButton.classList.remove('remove-bottom-radius');
1931
}
2032
});
2133
});

layouts/partials/coveo-atomic-search.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<atomic-search-interface id={{ $id }}>
44
<atomic-search-box redirection-url={{ $redirectionUrl }} class="header-search-box">
55
</atomic-search-box>
6-
</atomic-search-interface>
6+
</atomic-search-interface>

layouts/partials/coveo-legacy-search.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

layouts/partials/coveo-legacy.html

Lines changed: 0 additions & 98 deletions
This file was deleted.

layouts/partials/sidebar-v2.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@
1212
</label>
1313
</div>
1414
</div>
15-
<div class="sidebar__search">
16-
<!-- Standalone search box. -->
17-
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-sidebar") }}
18-
</div>
19-
<div class="sidebar__content">
20-
<a class="skip-link" href="#maincontent">Skip Navigation</a>
21-
{{ partial "sidebar-list.html" (dict
22-
"firstSection" .FirstSection
23-
"currentUrl" .Permalink
24-
"currentPage" .
25-
"idPrefix" ""
26-
) }}
15+
<div class="sidebar__content__wrapper">
16+
<div class="sidebar__search">
17+
<!-- Standalone search box. -->
18+
{{ partial "coveo-atomic-search.html" (dict "id" "search-standalone-sidebar") }}
19+
</div>
20+
<div class="sidebar__content">
21+
<a class="skip-link" href="#maincontent">Skip Navigation</a>
22+
{{ partial "sidebar-list.html" (dict
23+
"firstSection" .FirstSection
24+
"currentUrl" .Permalink
25+
"currentPage" .
26+
"idPrefix" ""
27+
) }}
28+
</div>
2729
</div>
30+
2831
</div>

0 commit comments

Comments
 (0)