-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathHeader.astro
More file actions
88 lines (75 loc) · 1.8 KB
/
Header.astro
File metadata and controls
88 lines (75 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
import config from 'virtual:starlight/user-config';
import LanguageSelect from 'virtual:starlight/components/LanguageSelect';
import Search from 'virtual:starlight/components/Search';
import SiteTitle from 'virtual:starlight/components/SiteTitle';
import SocialIcons from 'virtual:starlight/components/SocialIcons';
import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
const shouldRenderSearch =
config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro';
---
<div class="fg-header">
<div class="fg-title sl-flex">
<SiteTitle />
</div>
<div class="fg-search sl-flex print:hidden">
{shouldRenderSearch && <Search class="fg-search-control" />}
</div>
<div class="fg-right sl-hidden md:sl-flex print:hidden">
<div class="fg-social sl-flex">
<SocialIcons />
</div>
<ThemeSelect />
<LanguageSelect />
</div>
</div>
<style>
.fg-header {
display: flex;
align-items: center;
gap: var(--sl-nav-gap);
min-width: 0;
width: 100%;
}
.fg-title {
flex: 0 0 auto;
min-width: max-content;
overflow: visible;
}
.fg-search {
flex: 1 1 16rem;
min-width: 0;
}
.fg-search :global(site-search) {
display: block;
width: 100%;
}
.fg-search :global(button[data-open-modal]) {
max-width: 22rem;
}
.fg-right,
.fg-social {
align-items: center;
gap: 1rem;
}
.fg-right {
flex: 0 0 auto;
margin-inline-start: auto;
min-width: max-content;
}
.fg-social::after {
content: '';
height: 2rem;
border-inline-end: 1px solid var(--sl-color-gray-5);
}
@media (max-width: 63.999rem) {
.fg-search {
flex-basis: 14rem;
}
}
@media (max-width: 50rem) {
.fg-search :global(button[data-open-modal]) {
max-width: 100%;
}
}
</style>