[wp-trac] [WordPress Trac] #51828: gallery items not aligned when row has less items than column count
WordPress Trac
noreply at wordpress.org
Thu Nov 19 20:42:48 UTC 2020
#51828: gallery items not aligned when row has less items than column count
--------------------------+---------------------------------------
Reporter: rolekwp | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Gallery | Version: 5.5.3
Severity: minor | Keywords: has-patch has-screenshots
Focuses: |
--------------------------+---------------------------------------
If a gallery contains not enough images to fill up all columns, in some
cases the layout looks wrong. In the last row, the images are spaced
evenly over the row, but the alignment is off.
Screenshot with problem:
https://snipboard.io/yZEabf.jpg
The problem, as far as I can see, is that there aren't enough gallery-item
flex boxes to ensure the layout matches the layout of a full row.
I simple fix (although I am altogether not sure if this is the right way
to go) is to end the row with just as many empty gallery items as needed
to fill up the row. The attached patch does this, and seems to fix the
problem.
Screenshot with fix:
https://snipboard.io/IdtlJh.jpg
I would also be fine if the three images were spaced evenly over the row,
but then the left and right alignment should be the same. I don't know how
that could be achieved.
This is with the neve theme. I don't have a reproduction with the default
theme, sorry.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51828>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list