Allow blocks to handle align as a classname instead of a wrapper block #31201
Labels
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Currently, if a block offers alignment handling, it wraps the block in a [data-align] div, regardless of if the block supports the light wrapper. This breaks any styling that relies on a block's placement in a container or relation to other blocks (e.g. first/last child, or proceeding a sepcific other block).
What is your proposed solution?
Either an
alignWrapper
support flag, or have thealign
support accept an object with the values and withWrapper specified (would also potentially allow additional alignment-related rules to be specified). This would then tell thewith-data-align
hook to apply it as a classname rather than wrapperProps.The former is how I'm patching it in on a project, as a BlockListBlock filter that runs just before withDataAlign, removing the align proper from wrapperProps and adding it as a class instead.
The text was updated successfully, but these errors were encountered: