Gallery Block: Try masonry layout option #4734
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a "masonry layout" option to the gallery block inspector. Toggling this will let you show your gallery in a masonry style layout instead of the default one. "Masonry" refers to having either the width or the height vary, yet laying out items so items fit snugly edge to edge.
GIF:
This PR is unfinished. The masonry option isn't saved yet, and as a result the frontend styles don't output. Also, the crop feature is tied to the default style of the gallery, so we'd probably want to "gray" the crop option if you choose the masonry option. But it works in the editor, so you can try it.
Before I do any work to polish this any more, the question is: do we want this feature as part of the stock gallery, or should this be left to plugins to build?