-
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: try caption as inner block #31823
Conversation
Size Change: +569 B (0%) Total Size: 1.32 MB
ℹ️ View Unchanged
|
I really like this idea. |
@carolinan Thanks for the feedback! Yes, perhaps we can remove the block movers for now, but maybe they're worth restoring in the future to move the caption above or below the image. I think we should allow the user to decide. According to the spec, you can position it anywhere you like. :) |
This is great! Thank you very much for working on this, Ella! This is what I see: One general problem with the caption is that it aligns to the boundary box. Inner-Caption-alignment.mp4Associated issues: Image block selecting medium or thumbnail does not relocate caption - caption centered in relation to boundry box. Important comment: #13684 (comment) Missing text-align for image caption |
That happen in |
One of the most obvious problems with alignment is as I mentioned above. That caption aligns to the boundary box. This means when the image is smaller than the boundary box the caption alignment will be off. I believe the first challenge is figuring out a way to align the caption to the image inside the boundary box. So that we will automatically see the caption center aligned to the image at the size it is seen. Be it Full, Large, Medium or thumbnail. |
@paaljoachim I don't understand how the PR is different from trunk. It looks the same to me. |
Hey @ellatrix 1- I assume the first step is making the caption an inner block. I assume the misunderstanding is that I brought up the caption alignment issue which is not really a part of this PR. |
Nice. Before: After: This is a cool PR, and the promise of a simpler API, a reused block interface, and alignments, that's awesome. However the PR also highlights that we still have some work to do with the block interface:
I definitely think we'll want this at some point. The block is the primary API to emphasize here, and improving the block API, moving more and more towards blocks and block nesting, is a symbiotic relationship that improves all aspects of it. In this case, I think we will want to improve the block appenders and parent/child interface a little bit before we move too much farther with this one. |
It would be nice to get an update on this PR. |
@glendaviesnz @andrewserong I believe you might want to know about this PR. |
Tbh, I still really want this, but not sure if I will ever try it again (lot of other things to do) and it's probably best to start a new PR. |
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Description
Having a caption as a block would mean it's super easy to add alignment and typography controls.
This also means we no longer need the horrible
inlineToolbar
rich text API.Code-wise it's a pretty easy change to make.
How has this been tested?
Screenshots
Types of changes
Checklist:
*.native.js
files for terms that need renaming or removal).