Skip to content

Commit b7276ed

Browse files
authored
Merge pull request #36 from mobiera/fix/nav-breakpoints
fix(nav): hide the hamburger on desktop and the Contact button on phones
2 parents b689046 + 1f9f8b4 commit b7276ed

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

app/components/Nav.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ export default function Nav() {
5959
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" aria-hidden="true"><circle cx="12" cy="12" r="4" /><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4" /></svg>
6060
)}
6161
</button>
62-
<Link href="/contact" className="btn btn-primary hidden sm:inline-flex">Contact</Link>
63-
<button type="button" className="menu-btn md:hidden" aria-label="Menu" aria-expanded={open} onClick={() => setOpen((v) => !v)}>
62+
<Link href="/contact" className="btn btn-primary nav-contact">Contact</Link>
63+
<button type="button" className="menu-btn" aria-label="Menu" aria-expanded={open} onClick={() => setOpen((v) => !v)}>
6464
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" stroke="currentColor" strokeWidth="1.6" aria-hidden="true"><path d={open ? "M4 4l12 12M16 4L4 16" : "M3 6h14M3 10h14M3 14h14"} /></svg>
6565
</button>
6666
</div>
6767
</div>
6868
{mounted && open && (
69-
<div className="mobile-menu md:hidden">
69+
<div className="mobile-menu">
7070
<nav className="container-x" aria-label="Mobile">
7171
{NAV.map((l) => (
7272
<Link key={l.href} href={l.href} className={isActive(l.href) ? "active" : undefined}>

app/globals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ a { color: inherit; }
156156
border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer;
157157
}
158158
.theme-toggle:hover, .menu-btn:hover { color: var(--ink); border-color: var(--violet); }
159+
/* Breakpoints live here, not in Tailwind utilities: these component rules are
160+
unlayered, so a utility like md:hidden would lose to them. */
161+
.nav-contact { display: none; }
162+
@media (min-width: 640px) { .nav-contact { display: inline-flex; } }
163+
@media (min-width: 768px) { .menu-btn, .mobile-menu { display: none; } }
159164
.mobile-menu { border-top: 1px solid var(--rule); background: var(--bg); }
160165
.mobile-menu nav { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; padding-bottom: 18px; }
161166
.mobile-menu nav a { padding: 8px 0; font-weight: 600; }

0 commit comments

Comments
 (0)