godaddy-wordpress / godaddy-wordpress/coblocks
Offset Gallery: themes without specified `figure` margins can break gallery gutter settings in editor
- Dominant language
- JavaScript
- Stars
- 794
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
### 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.
Contributor guide
Assessment
This issue has not been assessed yet.