Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stacimc opened this issue May 11, 2021 · 1 comment
Closed

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

stacimc opened this issue May 11, 2021 · 1 comment

Comments

@stacimc
Copy link
Contributor

stacimc commented May 11, 2021

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
@stacimc
Copy link
Contributor Author

stacimc commented May 12, 2021

Resolved in #31726

@stacimc stacimc closed this as completed May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant