Skip to content

Commit

Permalink
Merge pull request #4513 from owid/sitenav-updates
Browse files Browse the repository at this point in the history
✨ Site Nav Updates
  • Loading branch information
ikesau authored Feb 18, 2025
2 parents 2a251cd + 9f37830 commit 4a81e8c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 9 deletions.
10 changes: 8 additions & 2 deletions site/SiteNavigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
flex-direction: row;
justify-content: space-between;
align-items: center;
@include column-gap(16px);
padding-top: 12px;
padding-bottom: 12px;
@include sm-up {
@include column-gap(24px);
}
@include md-only {
@include column-gap(0px);
}

.SiteNavigationToggle--mobile-menu {
flex: 1; // center owid logo
Expand Down Expand Up @@ -105,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
5 changes: 4 additions & 1 deletion site/SiteNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export const SiteNavigation = ({
</SiteNavigationToggle>
</li>
<li>
<a href="/latest">Latest</a>
<a href="/data">Data</a>
</li>
<li>
<a href="/data-insights">Insights</a>
</li>
<li className="with-relative-dropdown">
<SiteNavigationToggle
Expand Down
8 changes: 4 additions & 4 deletions site/SiteResources.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ export const SiteResources = () => {
return (
<ul>
<li>
<a href="/data">Data Catalog</a>
<a href="/latest">Latest Articles</a>
</li>
<li>
<a href="/data-insights">Daily Data Insights</a>
<a href="/explorers">Data Explorers</a>
</li>
<li>
<a href="/sdgs">Sustainable Development Goals Tracker</a>
<a href="/sdgs">SDG Trackers</a>
</li>
<li>
<a href="/teaching">Teaching Hub</a>
<a href="/teaching">Teaching Materials</a>
</li>
</ul>
)
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 4a81e8c

Please sign in to comment.