-
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 image alignment #5209
Fix image alignment #5209
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,8 +177,6 @@ export const settings = { | |
|
||
if ( width ) { | ||
figureStyle = { width }; | ||
} else if ( align === 'left' || align === 'right' ) { | ||
figureStyle = { maxWidth: '50%' }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know there have been discussions about whether to add this or not, not sure about the conclusion here though @jasmussen There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep — mostly I'm in the camp of the fewer inline styles, the better, because themes can't override them without using |
||
} | ||
|
||
return ( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
.wp-block-image { | ||
width: fit-content; | ||
} | ||
|
||
.wp-block-image figcaption { | ||
margin-top: 0.5em; | ||
color: $dark-gray-300; | ||
|
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.
If I understand properly, this fix PR is meant for the frontend, is this really necessary? we just merged #5142 that refactors how float work where the idea was to make floats work in a generic way in the editor not requiring specific handling per block.
Can you explain why do we need this specific handling? right now the block nodes (
wp-block-image
) are not floated in master but their container is in a generic way to avoid having to do it in each block.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.
On further repo reading, I ran into the same bug as #3945, but it may require more attention to properly address the behaviour that causes #3944.