I am trying to define a block variation that has an innerblock with a margin. I was able to set the color of the innerBlock just fine, but for the life of me, I can't make the margin work.
Here's what I currently have:
registerBlockVariation("core/group", {
// ...
innerBlocks: [
[
"core/heading",
{
textColor: "white", // this works fine
spacing: {
margin: {
top: "var(--wp--preset--spacing--50)", // does not work
bottom: "var(--wp--preset--spacing--50)",
},
},
},
[],
],
],
});
This has no effect in the editor, and I don't see a style being overridden in the browser.
I've tried as many variations of this as I can think of, but the margin isn't getting picked up. Based on the docs, this seems like the correct way to do this, but I haven't found a resource that officially goes into how to style innerBlocks like this.
theme.json
can because both are defined in the same file. You're probably going to have to put in a number. What does it say if you choose that value on a block then look at the HTML comment with the attributes?