Image block margin/gap is overridden in the backend [Gutenberg 14 RC2]
Description
Block gap is being overridden on the backend.
EDIT: I just corrected the order in which the styles are applied, sorry!
Backend styles:-
.editor-styles-wrapper .is-layout-constrained > * + * {
margin-block-start: 80px; // <-- overridden
margin-block-end: 0;
}
.editor-styles-wrapper .wp-block-image {
margin: 0 0 1em 0;
}
Frontend styles:-
body .is-layout-constrained > * + * {
margin-block-start: 80px; // <-- working correctly
margin-block-end: 0;
}
.wp-block-image {
margin: 0 0 1em 0;
}
Step-by-step reproduction instructions
- Add a block
- Add an image beneath that block
- Check there is a top margin on the image block in the editor
- Check if the margin exists on the frontend
Screenshots, screen recording, code snippet

Environment info
- WordPress 6.0.1, Gutenberg 14 RC2, Twenty Twenty-Two / Blank Theme
- Chrome / Firefox
- Desktop with Windows 10
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
I just refreshed my memory a bit on selector specificity.. I believe the issue is that this .is-layout-constrained > * + * has the same specificity as .wp-block-image, and since the .wp-block-image rule is applied later in the document, it's overriding the block gap margins.
Thanks for reporting this. I could reproduce it:

@andrewserong mentioned that the margin is specified in the block.json of the image block: https://github.com/WordPress/gutenberg/blob/b47a77df5632f3ed476a53337f475e0e2f5b074c/packages/block-library/src/image/block.json#L104-L108
Hey thanks, I'm glad you found where it's coming from, I tried searching through the repository but gave up in frustration.
I think there are some other blocks affected by that style too.
I shared some additional context in https://github.com/WordPress/gutenberg/pull/41689#issuecomment-1220674662.
Proposed fix here: https://github.com/WordPress/gutenberg/pull/43792