-
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
Image Block's Alignment setting impacts padding once nested inside Row block #50263
Comments
@tellthemachines this seems to be another case where maybe the alignment option needs to be reset when a block is moved. |
I can reproduce the issue but only on the front end; in the editor I can't see any difference between alignfull and non-aligned images (tested with TT3). The difference I see in the front end isn't due to any styles attached to the alignfull class itself, but to the root padding styles being skipped for alignfull blocks. The extra space around the non-aligned image is the root padding. Looks like this is yet another instance of root padding aware alignments not behaving as expected. The alignment styles themselves are designed to only be applied when inside a suitable container, so it shouldn't be necessary to remove the classnames when moving blocks around (or when transforming parent blocks from, say, Group to Row). I can look at the root padding rules and try to find a workaround for this case but with any change to those rules there's always the chance something else will break elsewhere 😅 |
I dont know if it is related but i just encountered in my block theme that all elements that can be aligned left/right (float) are not respecting their constricted content bounds (set from template) in the editor when set to align left/right. I have solved it by adding following css to styles-editor.css
|
I think this one might also be fixed by #53259. |
I can no longer reproduce this in trunk so closing as fixed by #53259. |
Description
Originally reported here: Automattic/wp-calypso#76441
The Image Block's alignment setting (
none
,full-width
) impacts how the image appears once it's wrapped inside a Row block. In short, an image set tonone
before being placed in a Row block will retain padding, whereas an image set tofull-width
before being placed in a Row block will have no padding inside the row. This is most visible when the Row block itself is set to Full-Width.Because the Image block's
Align
tools are removed when it's nested insideRow
andStack
blocks, there's not a clear way to resolve this. One must un-nest the block and change the alignment, then re-nest, or transform the Row to a Group block, update the alignment setting on the image, then transform back to a Row.Step-by-step reproduction instructions
full-width
using the Align tool in the block toolbarfull-width
At this point, you should see the padding discrepancy in the editor, and you can preview/publish to see the issue on the live site as well.
Screenshots, screen recording, code snippet
Setup:
Screen.Capture.on.2023-05-02.at.11-11-03.mp4
Result:
Environment info
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: