Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions assets/sass/headings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ h1 {
margin-bottom: 2rem;
font-weight: 700;
text-wrap: balance;
scroll-margin-top: 7rem;
}

h2 {
Expand All @@ -13,7 +12,6 @@ h2 {
margin-bottom: 1rem;
font-weight: 700;
text-wrap: balance;
scroll-margin-top: 7rem;
}

h3 {
Expand All @@ -22,7 +20,6 @@ h3 {
margin-bottom: 1rem;
font-weight: 700;
text-wrap: balance;
scroll-margin-top: 7rem;
}

h4 {
Expand All @@ -31,9 +28,4 @@ h4 {
margin-bottom: 1rem;
font-weight: 700;
text-wrap: balance;
scroll-margin-top: 7rem;
}

sup {
scroll-margin-top: 7rem;
}
3 changes: 2 additions & 1 deletion assets/sass/navigation.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#header {
position: fixed;
position: sticky;
width: 100%;
top: 0;
box-shadow: 0 .4rem 1rem 0 rgba(0,0,0,.1);
Expand All @@ -9,6 +9,7 @@
background-color: var(--bg-default);
z-index: 5;
position: relative;
height: 6rem;
}

.o-header__wrapper {
Expand Down
4 changes: 2 additions & 2 deletions assets/sass/styles.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
html {
font-size: 62.5%;
color: var(--color-onLight);
scroll-padding-top: 8rem;
}

body {
Expand Down Expand Up @@ -29,9 +30,8 @@ a {
}
}

//space for fixed header
main {
margin-top: 8rem;
margin-top: 2rem;
}

.container.o-list:not(.o-list--news) {
Expand Down
19 changes: 17 additions & 2 deletions layouts/partials/search-slot.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,20 @@
const search = document.getElementById('search');
if (!search) return;
if (search.contains(e.target)) return;
const closeBtn = search.querySelector('.pagefind-ui__search-clear');
if (closeBtn) closeBtn.click();
const searchInput = search.querySelector('input.pagefind-ui__search-input');
if (searchInput && document.activeElement === searchInput) {
const closeBtn = search.querySelector('.pagefind-ui__search-clear');
if (closeBtn) closeBtn.click();
}
});

// Scroll to search on click
const search = document.getElementById('search');
if (search) {
search.addEventListener('click', function() {
search.scrollIntoView({ behavior: 'smooth', block: 'start' });
});
}
});

// Open search on Ctrl + K or Cmd + K
Expand All @@ -38,6 +49,10 @@
const searchElement = document.querySelector('#search input');
if (searchElement) {
searchElement.focus();
const search = document.getElementById('search');
if (search) {
search.scrollIntoView({ behavior: 'smooth', block: 'start' });
}
}
}
});
Expand Down
Loading