-
Notifications
You must be signed in to change notification settings - Fork 40
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
[UX] Provide a hamburger menu (or option) by default #2369
Comments
Thanks for making the feature request. A hamburger menu was one of the designated features of issue #2107 (Provide responsive drop-down menus out of the box):
To get the responsive drop-down on time in the 1.5 release, it was committed without the hamburger menu. @quicksketch said then in #2107 (comment):
Is there anybody who wants to make a PR based on @quicksketch's proposal and/or @herbdool's approach mentioned above? |
I have some code for this that I implemented on another site, I'll try to get a PR together soon, playing catch up 😛 |
As this is a feature, not a bug, I'm moving this to 1.6.0. |
Yes, it's a feature, but it was one of the designated features of the "Provide responsive drop-down menus out of the box" issue, and in my opinion it's important to provide the missing feature, no matter if it's a feature request or a bug report. |
This was the first feature-request I had on my D7 module for smartmenus too here and there is some recommended code at http://www.smartmenus.org/docs/#menu-toggle-button that makes it pretty easy. @wesruv amd @laryn you might want to review the commit there to see how that was done, it may helpful. The difference there is that I added a block/menu setting for if the hamburger was wanted, and here it sounds like we'll always be adding it in the theme. I think I like the setting approach better, but I'll leave it up to you guys to decide. |
I've taken the approach of adding a setting to the Basis theme. It'll only include the hamburger if the primary nav is present. |
What does this mean? If a menu block is present? If the menu block is showing the 'Primary navigation' menu? |
Out of the box Basis has a Primary Navigation block enabled. This provides an option for a hamburger on that menu alone. It's main_menu in the system. |
Thanks @herbdool for the PR. Tested it, works well! I like that there is a setting but as theme setting, it seems a bit far away. Without knowing what it would mean technically, I'd prefer to have the setting in menu blocks. I guess, we could need some more feedback, tagged the issue as such. |
My vote is for a block setting. That way it will work for all themes. |
I agree, a block setting seems best from a user standpoint. I don't know how much that complicates the PR or if it means a completely different approach. |
Makes sense to me. It can be bundled with the Primary Navigation block which also has the option for the dropdown. I'll look into it. |
Yep, the menu block is where I'd expect a setting for that to exist. Perhaps as a "Render as a hamburger menu" checkbox shown via ( ) Always |
...btw, it would be great if we had https://www.drupal.org/project/breakpoints in core so that themes and modules (like the admin_bar.module) can use them. |
...actually not themes. In Backdrop layouts could use the breakpoints. Right? |
I've updated my PR. That was a bit harder to figure out than I thought. I don't know if I've got a good approach but it seems to be the only way I've gotten it to work. There's a checkbox when you configure the Primary Navigation only and it allows you to display the menu toggle. I've created a template |
@klonos good suggestions re breakpoint, but I see those as new feature requests that can be added later. |
Hm, that doesn't sound right. The markup should be in the menu output itself, not in the output for the block around the menu. Yes, this sounds tricky... Hm... |
It's very important that we don't make assumptions about which menu people are going to be using as their main menu. However, I don't think it's super important that it work for more than one menu at a time. It looks like the changes you made are going to cover those bases @herbdool, nice work! @wesruv sounds like the ball is in your court? Looks like we're really close! :) |
I'm going to take a stab at this one since I just added/fixed a similar feature on https://www.drupal.org/project/smartmenus :) |
New PR is up at backdrop/backdrop#1708 I did some reworking of the CSS provided by @wesruv because the selectors weren't inline with the way we do CSS in the rest of core. I also added back the JS effect for sliding the menu open/closed since I couldn't determine if the CSS solution (using VH) would work on all browsers, and the JS is a proven solution. ( I basically put it back to the recommended CSS from the smartmenus library, but we can iterate and improve after Jan 1st if necessary.) I also cleaned up the markup to be easier for devs to read, and some of the PHP too, since I was in there anyway. This is ready for user-testing if we have any takers :) |
Had a quick look at the new PR: The hamburger button and the block setting (if to show the hamburger button on small screens) worked fine. |
@jenlampton I've put some comments on the PR |
Which PR needs testing? |
backdrop/backdrop#1712 needs testing. |
I closed the previous PR as the sandbox functionality seemed broken. Latest PR is now at backdrop/backdrop#1714. Some feedback:
|
Can you think of an example of that we can copy?
Hm, I missed that. I agree, we can get it back.
Yes, let's work on that tomorrow :) |
Then we just let |
okay, I think I got it:
|
Yay, new |
Is there a way to get the default menus to turn into a "☰ Menu" link that opens to the full menu, instead of the stacked version that is used by default? With any more than a few menu items it currently takes the whole screen on a phone and it would be nice to have it collapsed to start with.
Pulling a few of the responses from Gitter:
PR from @herbdool backdrop/backdrop#1686PR from @jenlampton backdrop/backdrop#1708PR from @njbooher backdrop/backdrop#1714PR from @jenlampton backdrop/backdrop#1715
The text was updated successfully, but these errors were encountered: