diff --git a/packages/block-library/src/cover/edit/index.js b/packages/block-library/src/cover/edit/index.js index 8c5488584094c..b3e67c4d4c55f 100644 --- a/packages/block-library/src/cover/edit/index.js +++ b/packages/block-library/src/cover/edit/index.js @@ -17,6 +17,7 @@ import { useSettings, useInnerBlocksProps, __experimentalUseGradient, + __experimentalUseShadowProps as useShadowProps, store as blockEditorStore, } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; @@ -289,7 +290,9 @@ function CoverEdit( { const isImgElement = ! ( hasParallax || isRepeated ); + const shadowProps = useShadowProps( attributes ); const style = { + ...shadowProps.style, minHeight: minHeightWithUnit || undefined, }; diff --git a/packages/block-library/src/cover/save.js b/packages/block-library/src/cover/save.js index 680e92a5f9177..4c4a300c91ed4 100644 --- a/packages/block-library/src/cover/save.js +++ b/packages/block-library/src/cover/save.js @@ -10,6 +10,7 @@ import { useInnerBlocksProps, getColorClassName, __experimentalGetGradientClass, + __experimentalGetShadowClassesAndStyles as getShadowClassesAndStyles, useBlockProps, } from '@wordpress/block-editor'; @@ -61,7 +62,9 @@ export default function save( { attributes } ) { const isImgElement = ! ( hasParallax || isRepeated ); + const shadowProps = getShadowClassesAndStyles( attributes ); const style = { + ...shadowProps.style, minHeight: minHeight || undefined, }; @@ -124,42 +127,48 @@ export default function save( { attributes } ) { style={ bgStyle } /> - { ! useFeaturedImage && - isImageBackground && - url && - ( isImgElement ? ( - { + { ! useFeaturedImage && + isImageBackground && + url && + ( isImgElement ? ( + { + ) : ( +
+ ) ) } + { isVideoBackground && url && ( +