added width style for align center issue in image block #39376
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
I have added the width:100% in .wp-block-image.aligncenter class hierarchy. So by doing this now image is align in center by older CSS text-align:center;
Why?
So the problem was when we add image in the group block then we are not able to align the image in the center. So the issue was mentioned in this ticket(link: #39291) and I solved this issue by this width css.
How?
The implementation details are very simple just open the file style.scss(path: packages/block-library/src/image/style.scss) and add the width 100% in .wp-block-image.aligncenter class hierarchy.
Testing Instructions
Screenshots or screencast
Image of editor side link: https://prnt.sc/vD8DpJWDgZNy
Image of front side link: https://prnt.sc/LZhJoIWS3m1S