-
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
Negative Margins behave unresponsively #66861
Comments
I tested the code and cannot see a bug. |
Thank you @hanneslsm for raising this discussion. I would like to share my perspective on this matter. I believe the primary goal should be to empower users to accomplish their design objectives directly within the Editor, minimizing their reliance on custom code implementation. Regarding the issue raised by @beafialho - thank you for raising the issue. My basic analysis reveals that while negative margins are functional on mobile devices, they currently maintain their horizontal orientation rather than transitioning to vertical alignment when stacked. ( i.e., if left and right margins are provided on desktop, they remain left and right on mobile as well ) Rather than implementing a hardcoded solution for the horizontal-to-vertical transition logic, I believe we can introduce a more flexible approach: a checkbox control that would allow users to specify whether margins should be inverted when content stacks on mobile devices. This would provide users with greater control over their responsive layouts. Alternatively, we can have an option to provide margins with regard to different screen sizes natively. |
I agree, that's why I have reported this. I believe this falls in the grey area between |
That said, given that #19909 exists, there probably isn't an action item for this issue, it is rather a reinforcement of the need for it to be addressed more holistically. |
I also feel this issue needs to be addressed more broadly. The lack of editing options on mobile and tablet makes things difficult, but if needed, we could consider a checkbox approach as well but it wont be really ideal. |
I don't think it can be assumed that a horizontal negative margin should be switched to a vertical negative margin on smaller screens: |
Great conversation, thanks for opening. I'd tend to agree with the feedback given, that there isn't a specific action item to address for the negative margins + columns block combo. |
Description
When trying to create a layout using negative margins, the Columns block is not working well ideally on mobile:
The intended look would be something like the following:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
negative-margins.mp4
Environment info
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: