-
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
Cover: Add layout support #37662
Cover: Add layout support #37662
Conversation
Size Change: +79 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
I tried this at some point, for me the main issue was that the "layout" styles didn't apply to the "inner blocks" wrapper but the block wrapper. I don't know how you're dealing with this issue here but for me, we need to change how layout filters/hooks work and try to apply it to the inner blocks wrapper which in some cases (cover) is different than the block wrapper. |
Thanks for pointing out the issue, Riad. I've not noticed that, but I'm sure it's still there. I will try to look into possible fixes next week. |
@youknowriad, what do you think about introducing the |
@Mamaduka I don't think we need any config, I think we should just make the inner blocks parent be the wrapper where the styles are applied. Is that achievable? (Maybe we need some internal hooks to do it) |
@youknowriad I need to do more testing, but that might be hard on the server-side: gutenberg/lib/block-supports/layout.php Lines 158 to 165 in a80da69
|
A quick note from a UX point of view, I worry about adding this not well understood setting to a commonly used block. For more context on points of confusion: #36082 |
Now that layout was added to the column block, it would be great to revisit this PR for 13.1+. Layout control is extremely powerful, mainly because it turns on blockGap for inner blocks, but is admittedly confusing for users. That said, both adding it to more blocks and improving the UI of the layout controls themselves, should ultimately reduce confusion. |
Regarding the inner blocks wrapper problem, we could always use the custom solution adopted for the Navigation block in #37473. Ideally there would be a standard way to solve this problem, but if it's non-trivial to work out, the Nav block way will at least ensure we have consistent Layout controls between different types of blocks until we find something better. |
Closing in favor of #43504. |
Description
PR adds experimental layout support to the Cover block.
Resolves #37036.
Similar to #29982 and #30077.
How has this been tested?
Screenshots
CleanShot.2021-12-30.at.15.44.20.mp4
Types of changes
Enhancement
Checklist:
*.native.js
files for terms that need renaming or removal).