-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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-collapse used with dropdown-toggle #41049
Comments
The second image you posted looks great to me. I'll have to see if I can reproduce it, thanks for sharing! I can get close by using the built in navbar-expand-md instead of lg but I really would prefer this type of hybrid option. The navbar expand with the separated dropdown looks clean to me and still allows the navbar to handle the additional navbar options that come with production environments that otherwise wouldn't fit on medium screens. |
I actually think this would look better on small screens as well, comparing our result to that on my phone. That said, I'll stick to the initial plan and share my fix for in-between sized screens (smaller and larger screens use previous behavior). Here's a demo of the fix, I added the fix to the navbar.scss file and it compiles with your linting software to product the css in the demo. I read that we could make pull requests without being on the core team, I'd be happy to continue working on this outside of this pull request/issue. Just let me know if you are looking for the contribution. I'd love to become part of your team or continue as a volunteer if that is an option. I have created a branch and am unable to push it for review. |
Hi again, glad to see you managed to get the navbar working to something you like better! I myself have also never contributed to this project but after your comments I decided to give it a shot and was able to successfully open a pull request with the changes I had when showing you those screenshots, so I am surprised that you weren't able to. I know your approach was slightly different than mine so I still think it could be worth it for you to submit a pull request (obviously I'm not an owner of this project so I have no clue whether this is even a change they would want). Following the steps in https://github.com/twbs/bootstrap/blob/ec96eacd0e6f297a64ee058b22ce9f567c0860e3/.github/CONTRIBUTING.md worked for me, I'll try and describe what I did in a little more detail though in case that solves your problem of being unable to push. Personally what worked for me was:
Hope this helps! P.S. If you're curious the only thing I had changed was to make the thing absolute, seems like you have some more ideas to make it better though: #41080 |
I'm not sure what I did the first time but thanks for encouraging a second attempt! Re-cloned and fresh keys and it worked fine. |
Prerequisites
Describe the issue
Using a drop down navbar item within a navbar collapse seems to break bootstraps styling. Specifically, the shrink to fit breaks, and expands to the full screen width (with some padding). I tested in 5 different screen sizes and found it looks fantastic on larger screens. The issue I am noticing really only impacts medium sized screens (tablets and small laptops). See the screenshots below. On a larger screen the dropdown box shrink wraps the button options within. On a medium sized screen, it blows up across the whole screen. This makes sense for phones, but on tablets over 60% of the screen width is wasted.
Large screens look great:
Medium screens not so much (looks fine on small using these same styles):
Reduced test cases
https://codepen.io/CJ-Pav/pen/mdNNPJy
What operating system(s) are you seeing the problem on?
Windows, macOS, Linux
What browser(s) are you seeing the problem on?
Chrome, Firefox
What version of Bootstrap are you using?
v5.2.3
The text was updated successfully, but these errors were encountered: