-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Missing text-align for image caption #19975
Comments
@strarsis You can use EditorsKit plugin which has text alignment option for captions. Here's the preview on how the Caption Alignment works : |
Hi This issue can be broader then only the image caption. I am thinking of creating a new issue, but since we have this issue I can instead add to it. Various blocks that use captions: Gallery Block (individual gallery image captions): Gallery Block - gallery caption: The above linked PR @epiqueras worked on was closed. See the discussion in the closed PR. Bottom line: RichText needs to support alignment caption. We basically need the caption alignment added to the caption toolbar. |
The issues with the toolbar has always been there (maybe there's even an issue for it). We've always forced it to centre. I think for these inline toolbars we'll have to detect text alignment and position the popover based on that. |
I came across this issue: |
My opinion: there should not be options to align or italic or color or anything the captions on various blocks, because the theme is styling them universally. There is some color style on some captions already, which should be removed, because they override the theme styles. |
@joyously: What if the theme designer wants to have two different kinds of caption alignments, left and center? In that case multiple block styles per block should be supported, so not only the general style of image (and its caption) but also its additional caption alignment context is selectable for the user. |
I don't agree that the user should select it per block or even per page. If the theme designer wants to provide choices, the theme designer should put a theme option in the Customizer. Giving the user too many options as a low level means that they can so easily make their site an inconsistent mess, and changing their mind involves re-editing each page. I say let the theme do its job of keeping things consistent and don't put too many options into the editor. (and that goes for Full Site Editing times 2) |
@joyously: I agree. I always cringe when I see a page builder with padding/margin options for each individual element. Not only does this mean that the user has to set it up, it also means that these settings have to be consistently applied among all the pages. |
+1 for having this control at the caption level. Our client uses two alignments for captions -- left if it describes the photo, right if it's accreditation for the photographer. They need to be able to choose this on a per image basis. |
@rogercoathup: Using image block styles wouldn't be a solution because only the caption text is aligned differently, having two separate block styles for each text alignment unnecessarily overcomplicates. |
@strarsis -- you are mis-reading my comment. I don't want them at the block level. I want the controls at the caption level. |
@rogercoathup: Misunderstanding, I meant the same :). |
+1 for adding alignment to the caption toolbar |
Hello, I added this css code found somewhere else, it works for me:
I miss also style since gutenberg. Now, with the new gutenberg wordpress editor, caption text is the same font than normal text, not aligned and with no background (i only succeeded to align the text with the CSS custom above). Just to be sure: is it the same for everybody (miss caption alignement and style) or does it depend of the theme used ? |
Hi @nonobio I just tested with the Theme Twenty Twenty One. Which can be downloaded from here. https://github.com/WordPress/twentytwentyone I added an image with a caption to see where the caption is located by default. Upon Medium or Thumbnail it did not. I added an issue for it on the Github repo for the theme. |
Hi :) Thanks for the test, i decovered that i could also test myself with "preview" theme ! :) So i did : you're right : caption is aligned to the center without custom CSS with Twenty Twenty theme. And the font is also a little different compared to the body text. But no grey background but it is'nt a big deal. I will contact my theme support or try to find css custom to apply a different font to caption text. If you have css code or plugin about customizing captions text it will help. Thanks a lot :) |
Hi :) I found a solution to align and styling my captions with gutenberg editor like it was on classic editor (on my theme).
I don't know anything in coding, i just tried and checked with Customizer\CSS to find the good solution. In fact, i was wrong : my old captions with classic editor wasn't aligned to center. All seems to work but tell me if you see something wrong with my code. Thanks :) |
IMO there should not be an option for this for individual captions. Maybe a global style option? |
I do think some images one might want the Image caption on the right, most in the center and others to the left. To create some design. But one could perhaps also have a default global style option. |
Associated: |
Describe the bug
Image captions have no text-alignment option in Gutenberg editor.
To reproduce
Steps to reproduce the behavior:
Notice that the image block caption has no text-alignment options.
Only the image block itself has alignment options.
Expected behavior
A text-align option for the image block caption.
Additional context
Maybe use image block caption field a fuller editor with more text-related options?
Or extend from a paragraph block/field?
The text was updated successfully, but these errors were encountered: