Skip to content

Spacing Support: All features display in UI if one is enabled #31725

Closed

Description

@stacimc

Description

The Spacing block support has support for both padding and margin independently; it is possible for a theme to opt in to only one or the other. Currently the UI for both is displayed as long as the block supports that feature, and the theme supports either feature.

Step-by-step reproduction instructions

  1. To test, you need a block that supports both padding and margin. Update the block.json for the Site Title block to include:
"supports": {
    // ...other supports
    "spacing": {
        "padding": true,
        "margin:": true
    }
}
  1. Update your theme.json to enable customPadding, but disable customMargin:
"settings": {
   "spacing": {
        "customPadding": true,
        "customMargin": false
    }
}
  1. Open the site editor and select the Site Title block. View the Inspector Controls.

Expected behaviour

The Spacing panel should be present, but only the Padding controls should render.

Actual behaviour

The Padding and Margin controls display.

WordPress information

  • WordPress version: 5.7.1
  • Gutenberg version: trunk
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes -- Twenty Twenty-One Blocks

Device information

  • Device: Desktop
  • Operating system: Mac Big Sur
  • Browser: Chrome 90

Activity

  1. stacimc commented on May 12, 2021

    @stacimc
    ContributorAuthor

    Resolved in #31726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions