Skip to content

Post Template: Applying background color adds inconsistent padding in the Editor #61655

Open

Description

Description

If you add background color to the Post Template block, it inherits padding from the styles from the List block in the Editor:

ol.has-background,ul.has-background {
    padding: 1.25em 2.375em
}

This padding is not applied on the front end, which is correct, in my opinion. We need to remove the padding in the Editor.

This issue seems related to #59455, cc @tellthemachines @ramonjd

Step-by-step reproduction instructions

  1. Open a new Playground instance and navigate to the Post Editor
  2. Using a Pattern, add one of the Posts options
  3. Inside the Post Template block, wrap all internal blocks in a Group and see the background color on the Group to any color.
  4. Then set the background color on the Post Template block to a different color. Notice how the padding is applied and that it does not show up on the frontend.

Screenshots, screen recording, code snippet

Editor Frontend
image image

Environment info

  • WordPress 6.5.3
  • Gutenberg 18.3

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

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

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Block] Post TemplateAffects the Post Template Block[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