Skip to content

Buttons block: block spacing value does not apply to both vertical and horizontal alignment #64948

@Nyiriland

Description

@Nyiriland

Problem

The Buttons block allows you to change the orientation from Horizontal (default) to Vertical, but there there is only a single Block Spacing setting (not separate options for vertical/horizontal). When a block spacing value is set, it only applies to the column-gap.

This is a screenshot from a Buttons block in a project I'm working on. The block is set to vertical orientation, with the Block-spacing value set to 1rem. You can see from the CSS output below that the Block-spacing is only applying to the column-gap on the front-end, and the the row-gap value is different (the value seems to be coming from core).

image

I'll note that the block-spacing gap does seem to apply properly to both orientations (via a single gap attribute) in the editor view. It's only when viewing the site on the front-end that there's separate column-gap and row-gap values.

What's expected

If there is only one Block Spacing option, it should affect both row & column gap, in both front-end and editor views.

Solution

A better solution might be to add separate vertical & horizontal Block Spacing options.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions