Skip to content

Accordion panel min-width CSS causes overflow when adding theme.json padding #73455

@justintadlock

Description

@justintadlock

Description

#73032 added some new default CSS to the Accordion Panel block. Specifically:

.wp-block-accordion-panel.wp-block-accordion-panel {
	min-width: 100%;
}

This causes overflow when the user adds left/right padding to the block via theme.json.

CC: @t-hamano

Step-by-step reproduction instructions

To test, add some padding to the Accordion Panel via theme.json:

{
	"styles": {
		"blocks": {
			"core/accordion-panel": {
				"spacing": {
					"padding": {
						"top": "var(--wp--style--block-gap)",
						"bottom": "var(--wp--style--block-gap)",
						"left": "var(--wp--style--block-gap)",
						"right": "var(--wp--style--block-gap)"
					}
				}
			}
		}
	}
}

Screenshots, screen recording, code snippet

Shown here where the panel overflows because the width is not respecting padding:

Image

Environment info

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Block] AccordionAffects the Accordion Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions