Skip to content

Commit 5ce5799

Browse files
committed
Redesign the navbar
1 parent 6aa24b6 commit 5ce5799

File tree

2 files changed

+104
-7
lines changed

2 files changed

+104
-7
lines changed

docusaurus.config.js

+47-7
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,60 @@ export default {
3737
src: 'img/spiro.svg',
3838
},
3939
items: [
40-
{ to: 'docs/getting-started', label: 'Docs', position: 'left' },
41-
{ to: 'blog', label: 'Blog', position: 'left' },
4240
{
43-
href: 'https://github.com/react-navigation',
44-
label: 'GitHub',
41+
type: 'docsVersionDropdown',
42+
position: 'right',
43+
},
44+
{
45+
to: 'docs/getting-started',
46+
label: 'Docs',
47+
position: 'right',
48+
},
49+
{
50+
to: 'blog',
51+
label: 'Blog',
4552
position: 'right',
4653
},
4754
{
48-
to: 'help',
55+
type: 'dropdown',
4956
label: 'Help',
57+
items: [
58+
{
59+
label: 'Issues',
60+
href: 'https://github.com/react-navigation/react-navigation/issues',
61+
},
62+
{
63+
label: 'Feature Requests',
64+
href: 'https://react-navigation.canny.io/feature-requests',
65+
},
66+
{
67+
label: 'Reactiflux Discord',
68+
href: 'https://www.reactiflux.com',
69+
},
70+
{
71+
label: 'Stack Overflow',
72+
href: 'https://stackoverflow.com/questions/tagged/react-navigation',
73+
},
74+
{
75+
label: 'Troubleshooting',
76+
to: 'docs/troubleshooting',
77+
},
78+
],
79+
position: 'right',
5080
},
5181
{
52-
type: 'docsVersionDropdown',
53-
position: 'left',
82+
href: 'https://x.com/reactnavigation',
83+
position: 'right',
84+
className: 'navbar-social-link navbar-social-link-x',
85+
'aria-label': 'X',
86+
position: 'right',
87+
},
88+
{
89+
href: 'https://github.com/react-navigation',
90+
position: 'right',
91+
className: 'navbar-social-link navbar-social-link-github',
92+
'aria-label': 'GitHub',
93+
position: 'right',
5494
},
5595
],
5696
},

src/css/custom.css

+57
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,63 @@ footer {
208208
var(--ifm-navbar-padding-horizontal);
209209
}
210210

211+
.dropdown > .navbar__link:after {
212+
top: 4px;
213+
transform: rotate(90deg);
214+
width: 10px;
215+
height: 10px;
216+
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E")
217+
no-repeat;
218+
mask-size: 100% 100%;
219+
background-color: currentColor;
220+
}
221+
222+
.navbar div[class*='colorModeToggle'] {
223+
margin: 0 0.5em;
224+
}
225+
226+
.navbar .DocSearch-Button {
227+
border-radius: var(--ifm-global-radius);
228+
}
229+
230+
.navbar .DocSearch-Button svg {
231+
width: 16px;
232+
height: 16px;
233+
}
234+
235+
@media (min-width: 997px) {
236+
.navbar__brand {
237+
width: calc(
238+
var(--doc-sidebar-width) - var(--ifm-navbar-padding-horizontal)
239+
);
240+
box-shadow: 1px 0 0 0 var(--ifm-toc-border-color);
241+
}
242+
}
243+
244+
.navbar-social-link::before {
245+
content: '';
246+
display: flex;
247+
background-color: var(--ifm-navbar-link-color);
248+
transition: background-color var(--ifm-transition-fast)
249+
var(--ifm-transition-timing-default);
250+
}
251+
252+
.navbar-social-link:hover::before {
253+
background-color: var(--ifm-navbar-link-hover-color);
254+
}
255+
256+
.navbar-social-link-x::before {
257+
width: 18px;
258+
height: 18px;
259+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z'/%3E%3C/svg%3E");
260+
}
261+
262+
.navbar-social-link-github::before {
263+
width: 20px;
264+
height: 20px;
265+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E");
266+
}
267+
211268
.menu {
212269
font-size: 93.75%;
213270
font-weight: var(--ifm-font-weight-normal);

0 commit comments

Comments
 (0)