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
- Register a block with the following criteria.
- Supports "shadow" = true.
- Uses
ServerSideRender to render the block output.
- In the block renderer callback on the PHP side use
get_block_wrapper_attributes to generate HTML attributes for the element surrounding the block.
- Add the block to a template.
- Add a Drop Shadow using the Styles section of the block.
- 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.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Description
The
@wordpress/server-side-renderpackage'sServerSideRendercomponent supports askipBlockSupportAttributesattribute 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 theskipBlockSupportAttributesattribute.Step-by-step reproduction instructions
ServerSideRenderto render the block output.get_block_wrapper_attributesto generate HTML attributes for the element surrounding the block.box-shadowis 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
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.