Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make floats work in the editor, same as frontend.
This changes the editor float code for the image so it matches and works the same as the front-end. That is, when an image is floated, the parent container (block container) retains its same max-width which usually allows a centered column to coexist with wide images. But it is zeroed out in height. The child element, the figure itself, is then floated, which allows the caption to share the same width as the figure, using a table-caption trick. The CSS is the same, front and backend, but the markup is not the same, so some CSS references map to different things. With the ultimate goal of WYSIWYG, this might be worth revisiting in the future, but is way out of scope for this PR since there are a ton of React wrappers necessary for resizing and other things. Note that this PR only touches images. If this is approved and merged in, we'll probably want to backport these changes to other blocks that can float, i.e. video, embed, cover image.
- Loading branch information