Skip to content

Commit

Permalink
✨ Fix SiteNav overflow on tablets
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesau committed Feb 18, 2025
1 parent ce7f6d6 commit 9f37830
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion site/SiteNavigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@
align-items: center;
justify-content: end;
height: $search-cta-height;
@include column-gap(16px);
@include column-gap(8px);
@include sm-only {
flex: 1; // center owid logo
}

.SiteNavigationToggle.newsletter-subscription {
// hide the newsletter button at the last little bit before we switch to the mobile view
@media (max-width: calc($sm + 40px)) and (min-width: $sm) {
display: none;
}
@include sm-only {
// when the donate button is hidden, it still captures the
// :last-child selector of the column-gap mixin of the parent
Expand Down
4 changes: 3 additions & 1 deletion site/search/Autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@
outline: none;
}

@include md-down {
// A magic number slightly higher than our $md breakpoint to ensure there's enough room
// for everything in the site nav between 960-1045px. Mirrored in Autocomplete.tsx
@media (max-width: 1045px) {
.aa-DetachedSearchButtonIcon svg {
fill: #fff;
}
Expand Down
4 changes: 3 additions & 1 deletion site/search/Autocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,9 @@ export function Autocomplete({
onClose,
className,
placeholder = DEFAULT_SEARCH_PLACEHOLDER,
detachedMediaQuery = "(max-width: 960px)",
// A magic number slightly higher than our $md breakpoint to ensure there's enough room
// for everything in the site nav between 960-1045px. Mirrored in Autocomplete.scss
detachedMediaQuery = "(max-width: 1045px)",
panelClassName,
}: {
onActivate?: () => void
Expand Down

0 comments on commit 9f37830

Please sign in to comment.