Skip to content
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

[Feature]: Enhance navbar to integrate more configuration #1713

Closed
coratgerl opened this issue Dec 26, 2024 · 4 comments · Fixed by #1719
Closed

[Feature]: Enhance navbar to integrate more configuration #1713

coratgerl opened this issue Dec 26, 2024 · 4 comments · Fixed by #1719

Comments

@coratgerl
Copy link
Contributor

coratgerl commented Dec 26, 2024

What problem does this feature solve?

Currently, we have no way to make the navbar sticky on mobile, which I think could be improved. I propose adding a navbar object in the theme config to allow configuration of various navbar elements, such as its position (sticky or not) on mobile and desktop.

Additionally, we could integrate the hideNavbar functionality into a hide field within the navbar object. If we decide to move hideNavbar, we could deprecate it first before fully migrating to avoid breaking compatibility.

I'm not sure what you think about this approach and whether it would be suitable. What are your thoughts?

I can propose myself to do this change.

What does the proposed API look like?

themeConfig: {
   navbar : {
       position : {
           onMobile: 'sticky' | 'relative',
           onDesktop: 'sticky' | 'relative',
       },
       hide: 'never' | 'always' | 'auto',
       // Others potential configs in future ...
       closeIcon: boolean
   }
}
@Timeless0911
Copy link
Contributor

Can we make themeConfig.hideNavbar configuration work on mobile instead? Adding themeConfig.navbar configuration is a bit too complicated I think.

@coratgerl
Copy link
Contributor Author

If I correctly understand what themeConfig.hideNavbar does, it only hide or not the navbar, it is not related to the position of the navbar no ?

@Timeless0911
Copy link
Contributor

If I correctly understand what themeConfig.hideNavbar does, it only hide or not the navbar, it is not related to the position of the navbar no ?

What's the difference between sticky and relative, the current status is that when navbar is not hided, it will sticky at the top.

@coratgerl
Copy link
Contributor Author

Ok I understand so there is a bug actually because on mobile the navbar is not sticky at the top. I will fix this in a PR so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants