coblocks
coblocks copied to clipboard
Offset Gallery: themes without specified `figure` margins can break gallery gutter settings in editor
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:
- Activate Twenty Twenty-One
- Create a post
- Insert an Offset Gallery with multiple images
- Set gutter to None
- Observe the spacing between the images in the editor
- Publish and view the post
- Notice the spacing is correct (no gutter) on the front end
- Activate a theme like Twenty Twenty, which does set 0 margins on figure elements in the editor
- 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.