Skip to content

Commit

Permalink
Merge pull request #707 from near/feat/viewport-centered-nav
Browse files Browse the repository at this point in the history
Centering nav to viewport for larger screens
  • Loading branch information
calebjacob committed Oct 13, 2023
2 parents 680e74d + d39584b commit fa1eb5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/components/navigation/desktop/DesktopNavigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const Wrapper = styled.div<{
const Container = styled.div`
display: flex;
align-items: center;
justify-content: center;
height: 100%;
margin: 0 auto;
`;
Expand All @@ -46,7 +45,6 @@ const Logo = styled.a`
text-decoration: none;
cursor: pointer;
outline: none;
margin-right: auto;
transition: all 200ms;
border-radius: 4px;
Expand Down
10 changes: 9 additions & 1 deletion src/components/navigation/desktop/MainNavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ import { navigationCategories } from '../navigation-categories';
const Wrapper = styled.div`
position: relative;
display: flex;
justify-content: center;
z-index: 1;
flex-grow: 1;
padding: 0 1rem;
height: var(--nav-height);
@media (min-width: 1145px) {
// This center aligns the nav items in the center of the viewport on larger screens
position: absolute;
left: 0;
right: 0;
margin: 0 auto;
max-width: min-content;
}
`;

const NavRoot = styled(NavigationMenu.Root)`
Expand Down

0 comments on commit fa1eb5d

Please sign in to comment.