Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer5 Navbar is Fixed Now #6295

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Dungeon-Masterji
Copy link

Description

This PR fixes #6285

Notes for Reviewers

Signed commits

  • Yes, I signed my commits.

Signed-off-by: Aditya Raj <[email protected]>
@l5io
Copy link
Contributor

l5io commented Mar 9, 2025

🚀 Preview for commit 759386a at: https://67cd9f02e67f894800ec9efb--layer5.netlify.app

@falgunmpatel
Copy link

@Dungeon-Masterji
You may notice that, the content is getting hidden behind the navbar. Adding a margin might fix it, but we can't determine the exact value that would work best across different screen sizes and layouts.

A better solution is to use position: sticky;. This ensures that the element stays positioned correctly relative to the viewport without overlapping the navbar, while still allowing it to scroll naturally with the page when needed. This way, the content automatically adjusts and remains visible without requiring hardcoded margins.

Let me know if you need any further clarifications.

Thanks!

z-index: 9999;
top: 0;
background-color: ${(props) => props.theme.body};
transition-property: color, background-color;
transition-duration: 0.8s;
transition-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed an extra blank line—keeping changes minimal helps reviewers focus on the key updates. Would you mind removing it? Appreciate your efforts! 😊

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing that out! I've made the change. Your attention to detail is super helpful! 👍

@@ -2,13 +2,15 @@ import styled from "styled-components";

const NavigationWrap = styled.header`
width: 100vw;
position: fixed;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
position: fixed;
position: sticky;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion! I've replaced position: fixed with position: sticky as you recommended. Initially, I had tried using sticky earlier, but didn't notice any difference. However,navbar re-implementing it, I see that it's working as expected now. The element stays positioned correctly relative to the viewport, without overlapping the navbar, and scrolls naturally with the page. This solution is definitely more elegant and flexible than hardcoding margins. Appreciate your guidance!

@l5io
Copy link
Contributor

l5io commented Mar 9, 2025

🚀 Preview for commit d054390 at: https://67cde0a7f36b0428e8cc1d4c--layer5.netlify.app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Layer5 Navbar is No Longer Sticky
3 participants