I am trying to change the default top spacing (margin) for the Embed block used in Gutenberg. I noticed that for some reason, the default setting is
.wp-block-embed { margin: 0 0 1em; } which resets the top margin and removes the space between the preceding component.
My site is currently running a child block theme. I decided to apply global style override by adding the following to theme.json:
{ "version": 2, "$schema": "https://schemas.wp.org/wp/6.4/theme.json", "styles": { "blocks": { "core/embed": { "spacing": { "margin": { "top": "2rem" } } } } } } And this in fact adds the new top margin to the CSS, however it's earlier in the CSS compared to the original one, thus the override does not work:
I checked the location of that base 0 0 1em style and it is in:
/wp-includes/blocks/embed/theme.css Is there a smart way to override that spacing? I'd prefer to avoid overriding in theme's style.css as this seems wrong since theme.json has appeared.
It is probably worth mentioning that I am aware that I can change the spacing through Gutenberg Editor, however I want to apply the default, globally, when it comes to spacing.
