-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navbar shown on landing page on mobile #10785
Comments
Hi, I'm sorry this is not open-source yet but it will be. I figured out the problem. Leaving solution here as future reference. I see on In that case, the bug is that the menu list items are not being populated: I see that this is caused as setting navbar CSS affects also the hamburger menu. // ...
navbar: {
// .
items: [
{
to: '/windows',
label: 'Windows',
position: 'left',
className: withDefaultClass('navbarLink', 'nav-item__link', 'nav-item__link-windows'),
},
{
to: '/macos',
label: 'macOS',
position: 'left',
className: withDefaultClass('navbarLink', 'nav-item__link', 'nav-item__link-macos'),
},
{
to: '/linux',
label: 'Linux',
position: 'left',
className: withDefaultClass('navbarLink', 'nav-item__link', 'nav-item__link-linux'),
},
{
href: 'https://privacy.sexy',
label: 'Go to privacy.sexy app',
position: 'right',
className: withDefaultClass('navbarLink', 'nav-item__link', 'nav-item__link-privacysexy'),
},
], As you see, I created and used function withDefaultClass( // Because setting class overrides theme default
defaultClassName: keyof typeof DefaultCssClassNames,
...classNames: string[]
): string {
return [DefaultCssClassNames[defaultClassName], ...classNames].join(' ');
}
// ..
const DefaultCssClassNames = {
footerLink: 'footer__link-item',
navbarLink: 'navbar__link navbar__item',
}; Adding the default styles ( The reason that I added default styles manually was because was footers. footer: {
links: [
{
title: 'Operating systems',
items: [
{
label: 'Windows',
to: '/windows',
className: withDefaultClass('footerLink', 'nav-item__link-windows'),
},
{
label: 'macOS',
to: '/macos',
className: withDefaultClass('footerLink', 'nav-item__link-macos'),
},
{
label: 'Linux',
to: '/linux',
className: withDefaultClass('footerLink','nav-item__link-linux'),
},
], This this inconsistent behavior that using |
Thanks for reporting, we'll merge footer columns/links className in upcoming v3.7 (#10796) |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
Using version
3.6.3
withdocs
module, navbar is rendered as hamburger menu on landing page with empty contents, however it's not seen on desktop version.You can test it live on the webpage I'm setting up: privacylearn.com
Reproducible demo
No response
Steps to reproduce
Expected behavior
No menu on mobile, just like on desktop for consistency
Actual behavior
Hamburger menu is visible, clicking on it results in empty list
Your environment
No response
Self-service
The text was updated successfully, but these errors were encountered: