-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Aditya Raj <[email protected]>
🚀 Preview for commit 759386a at: https://67cd9f02e67f894800ec9efb--layer5.netlify.app |
@Dungeon-Masterji 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); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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! 😊
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
position: fixed; | |
position: sticky; |
There was a problem hiding this comment.
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!
Signed-off-by: Aditya Raj <[email protected]>
Signed-off-by: Aditya Raj <[email protected]>
Signed-off-by: Aditya Raj <[email protected]>
🚀 Preview for commit d054390 at: https://67cde0a7f36b0428e8cc1d4c--layer5.netlify.app |
Description
This PR fixes #6285
Notes for Reviewers
Signed commits