Skip to content
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

Gallery columns don't match with other full width elements #4548

Closed
2 tasks
Axinet opened this issue Jan 17, 2018 · 0 comments
Closed
2 tasks

Gallery columns don't match with other full width elements #4548

Axinet opened this issue Jan 17, 2018 · 0 comments
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@Axinet
Copy link

Axinet commented Jan 17, 2018

Issue Overview

Gallery with 2 columns is narrower than centered image (both blocks should match main column/paragraph width).

Steps to Reproduce (for bugs)

  1. Insert centered image
  2. Insert 2 column gallery
  3. Switch to frontend view
  4. Last gallery image ends at a different position than a single image.

All desktop browsers that show gallery (IE11 doesn't)

Expected Behavior

Gallery with should match singl image/paragraph width like in gutenberg editor in admin:
31453423-6d413630-aeb2-11e7-9a46-64db1ca4bad5
Above screnshot is from admin but problem is on frontend (see below).

Current Behavior

There is visible gap on frontend (highlighted with blue boxes)
gallery issue

The screen comes from Gutenberg 2.0.0 (in version 1.9 gap was twice as wide but only at right side).

Possible Solution

For 2 columns and 2 images gallery adding

.wp-block-gallery.aligncenter .blocks-gallery-image:first-child {
    margin-left:0;
}
.wp-block-gallery.aligncenter .blocks-gallery-image:last-child {
    margin-right: 0;
}

solves the issue, didn't have time to enumerate it over different settings.
Margin styles from images come from /wp-content/plugins/gutenberg/blocks/build/style.css.

Related Issues and/or PRs

Could be related to Responsive image gallery block #4035 (it also mentions .blocks-gallery-image margins, but I don't understand from provided screen and description what is really issued there).

Todos

  • Tests
  • Documentation
@jeffpaul jeffpaul added the [Type] Enhancement A suggestion for improvement. label Jan 26, 2018
@karmatosed karmatosed added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. labels Apr 27, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this May 3, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants