forked from nulang-org/nulang
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHeader.astro
More file actions
150 lines (134 loc) · 4.12 KB
/
Copy pathHeader.astro
File metadata and controls
150 lines (134 loc) · 4.12 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
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';
/**
* Render the `Search` component if Pagefind is enabled or the default search component has been overridden.
*/
const shouldRenderSearch =
config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro';
---
<div class="header">
<div class="title-wrapper sl-flex">
<SiteTitle />
</div>
<div class="sl-flex print:hidden search-wrapper">
{shouldRenderSearch && <Search />}
</div>
<div class="sl-flex print:hidden right-group">
<nav class="header-nav" aria-label="Main navigation">
<a href="/getting-started/installation/" class="nav-link">
<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
<path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>
</svg>
<span class="nav-label">Docs</span>
</a>
<a href="https://github.com/dporkka/nulang" class="nav-link" target="_blank" rel="noopener">
<svg aria-hidden="true" width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/>
</svg>
<span class="nav-label">GitHub</span>
</a>
</nav>
<div class="sl-flex social-icons">
<SocialIcons />
</div>
<ThemeSelect />
<LanguageSelect />
</div>
</div>
<style>
@layer starlight.core {
.header {
display: flex;
gap: var(--sl-nav-gap);
justify-content: space-between;
align-items: center;
height: 100%;
}
.title-wrapper {
overflow: clip;
padding: 0.25rem;
margin: -0.25rem;
min-width: 0;
}
.right-group {
gap: 0.5rem;
align-items: center;
}
/* ── Header nav links ── */
.header-nav {
display: flex;
align-items: center;
gap: 0.125rem;
}
.nav-link {
display: inline-flex;
align-items: center;
gap: 0.375rem;
padding: 0.375rem 0.625rem;
border-radius: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
color: var(--sl-color-gray-2);
text-decoration: none;
transition: color 0.15s ease, background 0.15s ease;
white-space: nowrap;
}
.nav-link:hover {
color: var(--sl-color-accent-high);
background: var(--sl-color-accent-low);
}
.nav-link svg {
flex-shrink: 0;
opacity: 0.7;
transition: opacity 0.15s ease;
}
.nav-link:hover svg {
opacity: 1;
}
/* Mobile: hide text labels, show icons only */
@media (max-width: 31.25rem) {
.nav-label {
display: none;
}
.nav-link {
padding: 0.375rem;
}
}
/* Mobile: hide social-icons divider when space is tight */
@media (max-width: 40rem) {
.social-icons::after {
display: none;
}
}
.social-icons {
gap: 1rem;
align-items: center;
}
.social-icons::after {
content: '';
height: 2rem;
border-inline-end: 1px solid var(--sl-color-gray-5);
}
@media (min-width: 50rem) {
.header {
display: grid;
grid-template-columns: auto 1fr auto;
gap: var(--sl-nav-gap);
align-items: center;
}
.search-wrapper {
justify-content: center;
}
.right-group {
gap: 0.5rem;
align-items: center;
}
}
}
</style>