-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix issue with responsive navigation causing wrapping. #35820
Conversation
Size Change: +149 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
@@ -230,7 +230,8 @@ | |||
// Menu items with no background. | |||
.wp-block-navigation, | |||
.wp-block-navigation .wp-block-page-list, | |||
.wp-block-navigation__container { | |||
.wp-block-navigation__container, | |||
.wp-block-navigation__responsive-container-content { | |||
gap: var(--wp--style--block-gap, 2em); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hrm. Good catch, I don't think it is. Let me take a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to open a PR for the padding issue on the social links, btw
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially we want to treat menu items and social links as if they were spaced with the same gap, as direct descendants of one container rather than each with their own child container.
How would you feel about applying display: contents;
on those containers? I feel like it would open a deep rabbit hole, so I'l probably fix the gap as is but it's a bit of a head scratcher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmh, I'm thinking, could we use column-gap
in this case instead of gap
? Then it only affects them horizontally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't so much the vertical issue, I slipstreamed a fix for that. It was more that we have this structure:
Navigation
Link Container
... menu items
Social Icons Container
... social icons
Essentially I feel like we want to apply gap as if the structure was this:
Navigation
Menu Item
Menu Item
Menu Item
Social Link
Social Link
Social Link
Right now this PR accomplishes that by applying gap to both the root navigation container, the Link container and the Social Icons container. Just wondering whether in the future/a separate exploration, there's a better way 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean, let me test this a bit
Superb review, thank you. I pushed some fixes to:
|
This is excellent, thank you for testing. I'm wondering what to fix here vs. in #35823, where I'm tackling a bit of the same issue. |
Let me take a quick look at that search+social links thing, I need to rebase the other one anyway! Thank you. |
Solid debugging. I removed the rule to unset the gap inside the open overlay menu after all, because the thing that causes problematic spacing is the margin: And so there's a little extra space now: But I believe I can/should fix that in #35823. The rest also looks good: |
Yeah, looks like getting rid of the margins is more consistent too with how we are aiming to use gap. Works for me and the tests look fine! |
* trunk: (494 commits) remove consecutive rc warning (#35855) Update Changelog for 11.8.0-rc.2 Bump plugin version to 11.8.0-rc.2 [RNMobile] Disable React Native E2E Tests (iOS) (#35844) Add section about using the schema during development (#35835) Add a method to disable auto-accepting dialogs (#35828) Wrap NavigationContainer with SafeAreaView. (#35570) Update Appium to 1.22.0 (#35829) Post Comment: Handle the case where a comment does not exist (#35810) Clear selected block when clicking on the gray background (#35816) Post excerpt: Don't print the wrapper when there is no excerpt (#35749) [Block] Navigation: Fix padding for social links on mobile (#35824) Fix issue with responsive navigation causing wrapping. (#35820) [Block Editor]: Fix displaying only `none` alignment option (#35822) Add API to access global settings, styles, and stylesheet (#34843) Mobile Release v1.64.1 (#35804) Add resizer to template part focus mode (#35728) Update Changelog for 11.7.1 Gallery block: Only show the gallery upload error message if mixed multiple files uploaded (#35790) Update Changelog for 11.8.0-rc.1 ...
Description
Fixes #35549.
When the mobile responsive overlay menu was enabled, subsequent child containers such as social links would wrap on a new line:
This PR fixes that:
How has this been tested?
Here's some test content:
Insert a navigation menu with both a few items, and some social links. Enable responsiveness ("mobile"), and verify the layout doesn't change. Verify also for the vertical version. And check that the overlay still looks good.
Checklist:
*.native.js
files for terms that need renaming or removal).