Skip to content

Commit

Permalink
make header float above on mobile to prevent layout shift
Browse files Browse the repository at this point in the history
  • Loading branch information
jones58 committed Sep 26, 2024
1 parent ab46656 commit b277cb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ function Header() {
}, [isOpen]);

return (
<header ref={headerRef} className="header z-50">
<header
ref={headerRef}
className="fixed top-0 left-0 right-0 z-50 bg-white sm:bg-transparent sm:relative"
>
<div className="flex justify-center sm:justify-between items-center space-x-5 py-10">
<Link to="/">
<h1 className="text-3xl">London Brutalist Map</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function Layout({
return (
<div className="sm:mx-10">
<Header />
{children}
<div className="py-28 sm:py-0">{children}</div>
<Footer />
</div>
);
Expand Down

0 comments on commit b277cb2

Please sign in to comment.