-
Notifications
You must be signed in to change notification settings - Fork 202
Add responsive navbar styles for various devices #610
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -89,3 +89,88 @@ | |||||||||||||||||||||||||||||||||||||||||||||||
| .icon-issue-closed { | ||||||||||||||||||||||||||||||||||||||||||||||||
| color: #cf222e; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Navbar Container */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar { | ||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||
| justify-content: space-between; | ||||||||||||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 1rem 2rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| flex-wrap: wrap; | ||||||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Navigation Links */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links { | ||||||||||||||||||||||||||||||||||||||||||||||||
| display: flex; | ||||||||||||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 1.5rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| list-style: none; | ||||||||||||||||||||||||||||||||||||||||||||||||
| flex-wrap: wrap; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Nav Link Styling */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links a { | ||||||||||||||||||||||||||||||||||||||||||||||||
| text-decoration: none; | ||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 1rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| transition: 0.3s ease; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Better Hover Effect */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links a:hover { | ||||||||||||||||||||||||||||||||||||||||||||||||
| opacity: 0.8; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+113
to
+122
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add keyboard focus states for accessibility. The navigation links only define ♿ Proposed fix to add focus states .nav-links a {
text-decoration: none;
font-size: 1rem;
transition: 0.3s ease;
}
-/* Better Hover Effect */
-.nav-links a:hover {
+/* Better Hover and Focus Effects */
+.nav-links a:hover,
+.nav-links a:focus {
opacity: 0.8;
+ outline: 2px solid currentColor;
+ outline-offset: 2px;
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess code changes that i have made is correct and no further changes are required
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If you'd like to revisit it in a future PR, the fix is straightforward: .nav-links a:hover,
.nav-links a:focus-visible {
opacity: 0.8;
outline: 2px solid currentColor;
outline-offset: 2px;
}No further action needed from my side — happy to help if anything else comes up! (´・ω・`) 🐇 |
||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Tablet Responsiveness */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| @media screen and (max-width: 992px) { | ||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar { | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 1rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links { | ||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 1rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links a { | ||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 0.95rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Mobile Responsiveness */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| @media screen and (max-width: 768px) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar { | ||||||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||
| align-items: center; | ||||||||||||||||||||||||||||||||||||||||||||||||
| text-align: center; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links { | ||||||||||||||||||||||||||||||||||||||||||||||||
| justify-content: center; | ||||||||||||||||||||||||||||||||||||||||||||||||
| margin-top: 1rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| gap: 0.8rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links a { | ||||||||||||||||||||||||||||||||||||||||||||||||
| font-size: 0.9rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| /* Small Mobile Devices */ | ||||||||||||||||||||||||||||||||||||||||||||||||
| @media screen and (max-width: 480px) { | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .navbar { | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 0.8rem; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links { | ||||||||||||||||||||||||||||||||||||||||||||||||
| flex-direction: column; | ||||||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||
| .nav-links a { | ||||||||||||||||||||||||||||||||||||||||||||||||
| width: 100%; | ||||||||||||||||||||||||||||||||||||||||||||||||
| display: block; | ||||||||||||||||||||||||||||||||||||||||||||||||
| padding: 0.5rem 0; | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+93
to
+176
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing hamburger menu implementation required by issue The PR objectives from issue
The current implementation simply stacks all navigation links vertically on mobile devices, which doesn't match the hamburger menu requirement stated in the issue this PR claims to close. 💡 Implementation guidanceA complete hamburger menu implementation typically requires:
<button class="hamburger-btn" aria-label="Toggle menu">
<span class="hamburger-icon"></span>
</button>
/* Hamburger button - hidden on desktop */
.hamburger-btn {
display: none;
background: none;
border: none;
cursor: pointer;
padding: 0.5rem;
}
/* Show hamburger on mobile */
`@media` screen and (max-width: 768px) {
.hamburger-btn {
display: block;
}
.nav-links {
display: none; /* Hidden by default */
position: absolute;
top: 100%;
left: 0;
right: 0;
background: var(--navbar-bg);
}
.nav-links.active {
display: flex; /* Show when toggled */
}
}
document.querySelector('.hamburger-btn').addEventListener('click', () => {
document.querySelector('.nav-links').classList.toggle('active');
});🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i guess code changes that i have made is correct and no further changes are required
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Just to flag for awareness: issue (´・ω・`) 🐇 |
||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
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.
Specify transition property for performance.
The transition applies to all properties (
transition: 0.3s ease), which can cause performance issues and unexpected behavior. Since onlyopacitychanges on hover, specify it explicitly.⚡ Proposed fix to specify transition property
.nav-links a { text-decoration: none; font-size: 1rem; - transition: 0.3s ease; + transition: opacity 0.3s ease; }📝 Committable suggestion
🤖 Prompt for AI Agents
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.
i guess code changes that i have made is correct and no further changes are required
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.
@Dippp10-ally, understood — I'll respect your decision. The suggestion to usetransition: opacity 0.3s ease;is a minor performance optimization, but it won't cause functional issues to leave it astransition: 0.3s ease;for now. Thanks for the clarification!(´• ω •`) ♡ 🐇