-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation Block expands to fill all available space, breaks justification. #35742
Comments
Thanks for the ticket. Can you try this against latest version of trunk? Just 5 hours ago I merged a change which I think might have fixed this: #35722 |
I pulled recent changes to /trunk and indeed the problem persists. It is only an issue when the block is in a container with display:flex as illustrated here:
The problem is coupled with an attribute that Blockbase applies to the header to achieve the design target:
So the two things don't play nice together. It may be that the same design target can be achieved using a between the menu and the rest of the content and giving that a flex-grow value via CSS instead. But it seems more appropriate to remove the forced 100% width to me. |
No, that doesn't address our use case in the Blockbase header. The content of the row can't be aligned right; some content is on the left (Site Title, logo, tagline) and some on the right (navigation). The elements in that header are dynamic though; there's no guarantee that any of them will be there so the layout mechanism has to take that into account. |
Understood, and if you use space-between, the site logo and site title will be spaced out as well: You could add an extra row wrapper around just the site logo and site title, combined with space-between on the topmost row: Adding With Even keeping TwentyTwentyTwo comes with a bunch of patterns that appear to accomplish a similar design. Would the approach taken there work for you? Many of these appear to rely on the extra row block grouping site logo/title together on the left: |
Closing this as the design can be achieved as noted above. Thank you! |
Thank you! And thank you for the ticket, it's helpful as we explore getting the flex rules just right 👌 |
Description
Seemingly due to this change the
wp-block-navigation__responsive-container
class now has awidth:100%
which causes the container to fill all available space. This breaks the justification of the menu layout, particularly right-aligned content such as Blockbase's header (as noted in this related issue).Step-by-step reproduction instructions
Activate Blockbase theme. Configure menus in customizer. (Bonus points for applying social menus).
Note that the navigation block does not justify content to the right despite that block's right justification option:
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true,"__unstableLocation":"primary","__unstableSocialLinks":"social"} /-->
Screenshots, screen recording, code snippet
Environment info
/trunk of Gutenberg
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: