Skip to content

Shadow styles are not removed from ServerSideRender when skipBlockSupportAttributes is true #65882

@lipemat

Description

@lipemat

Description

The @wordpress/server-side-render package's ServerSideRender component supports a skipBlockSupportAttributes attribute which is intended to exclude all block support generated styles from inner renders. This is useful because the block editor already adds these styles to the internal wrap within the editor context.

The majority block support generated styles work properly with the exception of shadow (Drop Shadow) block support. This style is passed on regardless of the skipBlockSupportAttributes attribute.

Step-by-step reproduction instructions

  1. Register a block with the following criteria.
    1. Supports "shadow" = true.
    2. Uses ServerSideRender to render the block output.
    3. In the block renderer callback on the PHP side use get_block_wrapper_attributes to generate HTML attributes for the element surrounding the block.
  2. Add the block to a template.
  3. Add a Drop Shadow using the Styles section of the block.
  4. Notice the CSS box-shadow is added to both the wrap created by the editor and the element generated on the PHP side render callback.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress version 6.6
  • TwentyTwentyTwo theme
  • Not browser specific.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions