Skip to content

group block padding can't be set by theme.json #33456

@andrewstaffell

Description

@andrewstaffell

Description

Group block padding (with background color) can't be configured through theme.json.

Step-by-step reproduction instructions

  1. Create theme.json:
{
  "version": 1,
  "styles": {
    "blocks": {
      "core/group": {
        "spacing": {
          "padding": "1rem"
        }
      }
    }
  }
}
  1. Insert Group block and assign any background colour
  2. Check block padding – should be 1rem following theme.json but is actually 1.25em 2.375em. The 1rem rule is output in the stylesheet (for .wp-block-group) but is overridden.

Expected behaviour

Padding should be 1rem – and it should only apply to group blocks with a background. Maybe this requires a different syntax in theme.json but this seems to be undocumented.

Actual behaviour

Group block padding is set indiscriminately 1.25em 2.375em, overriding any theme.json setting, and not specific to group blocks with background colour set.

WordPress information

  • WordPress version: 5.8 RC3
  • Gutenberg version: 11.0.0
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Yes, have tried with Twenty-Twenty One but it adds loads of its own CSS which obscures the problem. It's better exposed by a more minimal theme.

Device information

  • Device: MacBook Pro
  • Operating system: Mac OS 11.4
  • Browser: Chrome 92

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions