Skip to content

Commit

Permalink
Merge pull request #3505 from projectblacklight/search-form-anchor-focus
Browse files Browse the repository at this point in the history
Ensure that the search bar is visible when focused via anchor link
  • Loading branch information
jcoyne authored Jan 31, 2025
2 parents e5618b6 + 9cda50b commit b34d2fc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/assets/builds/blacklight.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ main {
display: flex;
}

.search-field,
.search-q {
scroll-margin: 5rem;
}

.documents-list {
--bl-results-document-margin-top: 1rem;
--bl-results-document-padding-top: 1rem;
Expand Down
7 changes: 7 additions & 0 deletions app/assets/stylesheets/blacklight/_search_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
border-bottom-left-radius: 0;
display: flex;
}

// ensure that the search bar appears at the top of the page when focused using
// anchor links, e.g. from the skip links navigation
.search-field,
.search-q {
scroll-margin: 5rem;
}

0 comments on commit b34d2fc

Please sign in to comment.