Skip to content

Commit c4220f3

Browse files
committed
fix: navbar spacing final
Signed-off-by: Harshil <[email protected]>
1 parent 0735fd3 commit c4220f3

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

layouts/partials/nav.html

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<!-- Navbar starts here -->
22
<nav>
33
<header>
4-
<div class="flex flex-row px-4 md:px-8 lg:px-12 xl:px-16 justify-between py-4 md:py-5 items-center">
4+
<div class="flex flex-row px-4 md:px-6 lg:px-12 xl:px-16 justify-between py-4 md:py-5 items-center">
55

66
<!-- Logo -->
77
<div>
8-
<a href="/"><img src="/logo/large_logo.svg" class="h-10 lg:h-12 xl:h-14" alt="Cloud Native Postgres Logo"></a>
8+
{{ $image := resources.Get "logo/large_logo.svg" }}
9+
<a href="/"><img src="/logo/large_logo.svg" class="h-8 lg:h-12 xl:h-14" alt="Cloud Native Postgres Logo"></a>
910
</div>
1011

11-
<!-- Desktop Menu -->
12-
<div class="hidden lg:block">
13-
<ul class="flex gap-4 xl:gap-8 text-base lg:text-lg xl:text-xl medium-gray my-5 pb-0">
12+
<!-- Desktop & Tablet Menu -->
13+
<div class="hidden md:block">
14+
<ul class="flex gap-3 lg:gap-4 xl:gap-8 text-sm md:text-base lg:text-lg xl:text-xl medium-gray my-5 pb-0">
1415
<li><a href="/blog">Blog</a></li>
1516
<li><a href="/tags/tutorial">Tutorials</a></li>
1617
<li><a href="/releases">Releases</a></li>
@@ -20,15 +21,15 @@
2021
</ul>
2122
</div>
2223

23-
<!-- GitHub Button (Desktop) -->
24-
<div class="hidden lg:block pt-2">
24+
<!-- GitHub Button -->
25+
<div class="hidden md:block pt-1.5">
2526
<a class="github-button" href="https://github.com/cloudnative-pg/cloudnative-pg"
26-
data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="large" data-show-count="true"
27+
data-color-scheme="no-preference: light; light: light; dark: dark;" data-size="small" data-show-count="true"
2728
aria-label="Star cloudnative-pg/cloudnative-pg on GitHub">Star</a>
2829
</div>
2930

30-
<!-- Hamburger (Mobile & Tablet) -->
31-
<div class="lg:hidden flex items-center" id="toggle-button">
31+
<!-- Hamburger click -->
32+
<div class="md:hidden flex items-center" id="toggle-button">
3233
<svg xmlns="http://www.w3.org/2000/svg" class="h-7 w-7" fill="none" viewBox="0 0 24 24" stroke="currentColor"
3334
stroke-width="2">
3435
<path stroke-linecap="round" stroke-linejoin="round" d="M4 6h16M4 12h16M4 18h16" />
@@ -37,7 +38,7 @@
3738
</div>
3839

3940
<!-- Mobile Menu -->
40-
<div class="hidden lg:hidden bg-gray-1 px-4 py-3" id="navi-list">
41+
<div class="hidden md:hidden bg-gray-1 px-4 py-3" id="navi-list">
4142
<ul class="space-y-2 text-lg charcoal">
4243
<li class="text-center py-2"><a href="/blog">Blog</a></li>
4344
<li class="text-center py-2"><a href="/tags/tutorial">Tutorials</a></li>
@@ -71,5 +72,19 @@
7172
toggleButton.addEventListener('click', () => {
7273
naviList.classList.toggle('hidden');
7374
})
75+
76+
// Responsive GitHub button sizing
77+
function updateGitHubButtonSize() {
78+
const githubButton = document.querySelector('.github-button');
79+
if (githubButton && window.innerWidth >= 1024) {
80+
githubButton.setAttribute('data-size', 'large');
81+
} else if (githubButton) {
82+
githubButton.setAttribute('data-size', 'small');
83+
}
84+
}
85+
86+
// Update on load and resize
87+
window.addEventListener('load', updateGitHubButtonSize);
88+
window.addEventListener('resize', updateGitHubButtonSize);
7489
</script>
7590
<!-- Navbar ends here -->

0 commit comments

Comments
 (0)