Spacing presets: add utility classes to block to indicate current spacing preset settings #45431
Labels
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Currently, the spacing presets are added to blocks via inline styles only. It would be useful to have utility classnames as well/instead in the same way that font-sizes do in order to allow further styling by themes based on presets applied.
What is your proposed solution?
Use the existing style engine infrastructure to apply utility classnames to the block wrappers where spacing presets have been applied.
Because of the large number of variations for spacing presets, eg.
has-bottom-padding-10
times 7+ preset slugs, x four sides = a minimum of 28 new utility classes with associated CSS vars being output, so it would be good if only the classes needed for the current page were output.The text was updated successfully, but these errors were encountered: