coblocks icon indicating copy to clipboard operation
coblocks copied to clipboard

Offset Gallery: themes without specified `figure` margins can break gallery gutter settings in editor

Open chad1008 opened this issue 4 years ago • 0 comments

Describe the bug:

On a theme like Twenty Twenty One where there are no theme-specified margins on figure elements in the editor, the gutter setting for the gallery block doesn't apply properly.

Without a theme-provided margin, the browser styles kick in applying default margins, which prevents the editor from accurately reflecting the end result that will be seen when the post/page is published.

To reproduce:

  1. Activate Twenty Twenty-One
  2. Create a post
  3. Insert an Offset Gallery with multiple images
  4. Set gutter to None
  5. Observe the spacing between the images in the editor
  6. Publish and view the post
  7. Notice the spacing is correct (no gutter) on the front end
  8. Activate a theme like Twenty Twenty, which does set 0 margins on figure elements in the editor
  9. Repeat the rest of the steps and compare results

Expected behavior:

The editor should reflect the gutterless gallery that's presented on the front end, regardless of the theme's styling.

chad1008 avatar Dec 10 '21 16:12 chad1008