-
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
Block Library: Add caption alignment to the image block. #20015
Conversation
It is awesome that caption alignment is being added! I thought that caption alignment would be a part of the bottom caption toolbar? |
If it’s at the bottom you won’t see it until you select the caption.
|
Glad to see this getting in too! I agree with @paaljoachim that we should add this to the Captions toolbar though. Using it on the block toolbar alludes that everything within the block would be aligned a particular way.
This is okay. Once you're typing a caption, it appears. |
If a user wants to do something that affects the caption it seems natural based on clicking into any block to affect it that they will also click into the caption area and then notice the caption toolbar. |
It’s pretty clear that this only affects text from the icon and label.
The other issue with having it in the caption toolbar besides it not being
as discoverable is that the caption toolbar is not a block toolbar. It is
the rich text component’s format toolbar. Adding a block-level, non-inline
control there would be a first and go against the general pattern already
established in the editor and API. If we absolutely require the alignment
control there then perhaps we should differentiate it from the rich text
formats somehow.
|
@epiqueras Would it be better to add separate classnames? I'm using |
No, we need to follow the standard to support theming. |
@epiqueras I would love to check the theming standard, do you have the link for the classnames standard? Using I know it might sound like I just want backward compatibility with EditorsKit because I'm using Thanks! |
The class is applied to the caption, not the entire block.
@jorgefilipecosta Do we have documentation for this somewhere? |
Oh! Sorry, forgot about that. I think it should be okay then. Thanks! |
There was a good discussion about this in today's core-editor chat. As a user, when realigning on the block-level, I expect everything in the block to realign. For example, take a look at the Paragraph block with an inline image. Everything realigns even though the icon is "text" alignment. Adding this to the block-level toolbar gives the perception that everything in the Image block, including the image, will realign. For this reason, it's important to add this to the caption toolbar because this alignment ONLY applies to the caption. While this may be technically different from the other caption controls, it's no different to the user. If alignment only changes the caption, but is located in the block-level toolbar, why isn't the Bold, Italic, etc. options? These all apply to the same thing from a user's perspective. Having them separate will cause some confusion. |
Agreed here. If I think of the caption as a "Caption" child block of the Image block, then this makes even more sense. |
I don't think it's any more confusing than mixing inline rich text formats with a block-level caption alignment option. Maybe "Change caption alignment." is clearer? I suggest we ship this until |
I believe the disconnect between the caption controls is too confusing. I'm in favor of holding off on this until we can get the alignment controls in the Caption toolbar next to the other caption-specific controls. @epiqueras I really appreciate your work here! Thank you! |
I went ahead and added some more information to the issue: #19975 (comment) |
Closes #19975
Description
This PR adds text alignment to the Image block's caption.
How has this been tested?
It was verified that setting the text alignment on the Image block's caption works as expected.
Screenshots
Editor
Front End
Types of Changes
New Feature: You can now align the captions in Image blocks.
Checklist: