Skip to content

Global padding: ".wp-block-block" class references in CSS selectors force padding to 0 in nested Group blocks #62597

Closed

Description

Description

WordPress 6.6 and Gutenberg plugin in latest version have global padding CSS selectors including references to a .wp-block-block class, in .has-global-padding :where(.has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) for example.

I don't think .wp-block-block is a class used either in the editor or in the front-end. Wouldn't that be a mistake? It seems to me that it should refer to the .wp-block-group class instead.

As a result of what appears to be an error, nested "Group" blocks have their internal margins reset to 0.

I detail the procedure to reproduce the bug below.

Step-by-step reproduction instructions

  1. Create a page on a WP with 6.6 Beta 2 and Twenty Twenty-Four block theme.
  2. Add a Group in full-width with no "Inner blocks use content width" option.
  3. Add another Group inside the first one with "Inner blocks use content width" option.
  4. Add paragraph or content in it.
  5. Save and view the page, you'll see the inline style applied to the inner group with wrong selector. Left and right padding values are reset to 0 when they shouldn't be. It's the global padding values that apply and should not be reset.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.6 Beta 2
  • Gutenberg latest

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

Labels

[Block] GroupAffects the Group Block[Feature] LayoutLayout block support, its UI controls, and style output.[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