File tree Expand file tree Collapse file tree 3 files changed +43
-34
lines changed Expand file tree Collapse file tree 3 files changed +43
-34
lines changed Original file line number Diff line number Diff line change 2
2
import HeaderLink from ' ./HeaderLink.astro' ;
3
3
import LinkToHome from ' ./LinkToHome.astro' ;
4
4
5
- const { fillBg } = Astro .props ;
5
+ const { sticky } = Astro .props ;
6
6
---
7
7
8
- <div
9
- class:list ={ [
10
- ' py-3' ,
11
- ' flex' ,
12
- ' flex-row' ,
13
- ' items-center' ,
14
- ' lg:ml--48' ,
15
- ' xl:ml--60' ,
16
- { ' bg-white' : fillBg },
17
- ]}
18
- >
19
- <div class =" w-48 xl:w-60" >
20
- <LinkToHome />
21
- </div >
22
- <div class =" mx-3 lg:hidden" ></div >
23
- <nav >
24
- <section class =" " >
8
+ <>
9
+ {
10
+ sticky && (
11
+ // "background" that spans from end to end horizontally
12
+ <div class = " absolute top-0 left-0 w-full z-20" >
13
+ <div class = " fixed h-13 bg-white/90 w-full" />
14
+ </div >
15
+ )
16
+ }
17
+ <!-- actual header -->
18
+ <header
19
+ class:list ={ [
20
+ ' py-3' ,
21
+ ' flex' ,
22
+ ' flex-row' ,
23
+ ' items-center' ,
24
+ ' lg:ml--48' ,
25
+ ' xl:ml--60' ,
26
+ { sticky: sticky },
27
+ { ' top-0' : sticky },
28
+ { ' z-20' : sticky },
29
+ ]}
30
+ >
31
+ <nav class =" w-48 xl:w-60" >
32
+ <LinkToHome />
33
+ </nav >
34
+ <div class =" mx-3 lg:mx-1" ></div >
35
+ <nav >
25
36
<ul class =" unset flex gap-4 [&>li]:p-0" >
26
37
<li ><HeaderLink href =" /toys" >Toys</HeaderLink ></li >
27
38
<li ><HeaderLink href =" /posts" >Posts</HeaderLink ></li >
28
39
</ul >
29
- </section >
30
- </ nav >
31
- < div class = " flex-grow " ></ div >
32
- < a
33
- href = " https://github.com/bizarre-binary/bizarre-binary.github.io "
34
- aria-label = " Open the repo on GitHub "
35
- >
36
- <div class = " i-bi-git text-yellow-400 text-xl " ></ div >
37
- </a >
38
- </div >
40
+ </nav >
41
+ < div class = " flex-grow " ></ div >
42
+ < a
43
+ href = " https://github.com/bizarre-binary/bizarre-binary.github.io "
44
+ aria-label = " Open the repo on GitHub "
45
+ >
46
+ < div class = " i-bi-git text-yellow-400 text-xl " ></ div >
47
+ </ a >
48
+ </header >
49
+ </>
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const pathMatchesUrl = (url: string) => {
25
25
<LinkToHome />
26
26
</header >
27
27
<!-- safe list class="text-gray-800" -->
28
- <div class =" px-3" >
28
+ <nav class =" px-3" >
29
29
<h2 class =" mt-10 my-2 font-bold text-gray-500" >Toys</h2 >
30
30
<ul class =" text-sm" >
31
31
{
@@ -38,7 +38,7 @@ const pathMatchesUrl = (url: string) => {
38
38
))
39
39
}
40
40
</ul >
41
- </div >
41
+ </nav >
42
42
</div >
43
43
</div >
44
44
<!-- place holder to represent the actual content-->
Original file line number Diff line number Diff line change @@ -32,10 +32,8 @@ const description = titleFromProps ? `${defaultTitle} - ${title}` : title;
32
32
<GlobalStyle />
33
33
<PWA />
34
34
</head >
35
- <body class =" m-auto max-w-prose px-2 md:px-0 flex flex-col [min-height:100svh]" >
36
- <header class =" sticky z-20 top-0" >
37
- <Header fillBg ={ true } />
38
- </header >
35
+ <body class =" m-auto max-w-prose px-2 md:px-0 flex flex-col [min-height:100svh] overflow-x-hidden" >
36
+ <Header sticky ={ true } />
39
37
<SideNavs />
40
38
<main >
41
39
<slot />
You can’t perform that action at this time.
0 commit comments