Open bacoords opened 4 months ago
I think maybe the styles need to be added in toStyles where variations rulesets are built.
Which leads me to another question: do variations support layout styles? Or, in other words, does getLayoutStyles()
need to be called inside the loop as well?
cc @aaronrobertshaw for tips
Which leads me to another question: do variations support layout styles? Or, in other words, does getLayoutStyles() need to be called inside the loop as well?
To date they don't. The general direction was to focus on the more common color/typography styling. Then expand out to things like spacing, border etc.
This one is on my list to look at. Appreciate the diff and head start @ramonjd 👍
I've spent some time digging into this issue and there are some complexities around generating layout styles for block style variations that won't conflict with general layout styles.
It is still on the cards to support block gap in block style variations however due to limited bandwidth at the moment, it might be some time before I can hone in on an adequate solution.
Description
When registering a block style variation (i.e. section style), the "blockGap" value isn't being output in the editor or on the front end. Other spacing values are working ("spacing.padding", "spacing.margin").
This is particularly useful in a number of blocks with flex layout options (column, group, navigation) and works when added as a value to the block in theme.json (styles.blocks) but not when added to a section style.
Step-by-step reproduction instructions
Add a new section style JSON file to your theme's /styles/ directory:
This doesn't work.
However, adding this to your theme.json:
works fine.
Screenshots, screen recording, code snippet
No response
Environment info
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