diff --git a/packages/block-library/src/cover/save.js b/packages/block-library/src/cover/save.js index 296dee39b0bb57..c12a316f30ea06 100644 --- a/packages/block-library/src/cover/save.js +++ b/packages/block-library/src/cover/save.js @@ -62,10 +62,14 @@ export default function save( { attributes } ) { ...( isImageBackground && ! isImgElement ? backgroundImageStyles( url ) : {} ), - backgroundColor: ! overlayColorClass ? customOverlayColor : undefined, minHeight: minHeight || undefined, }; + const bgStyle = { + backgroundColor: ! overlayColorClass ? customOverlayColor : undefined, + background: customGradient ? customGradient : undefined, + }; + const objectPosition = // prettier-ignore focalPoint && isImgElement @@ -99,9 +103,7 @@ export default function save( { attributes } ) { [ gradientClass ]: ! url && gradientClass, } ) } - style={ - customGradient ? { background: customGradient } : undefined - } + style={ bgStyle } /> { isImageBackground && isImgElement && url && ( diff --git a/test/integration/fixtures/blocks/core__cover__video-overlay.html b/test/integration/fixtures/blocks/core__cover__video-overlay.html index 0874131924fdf1..4e6828cdfc78c3 100644 --- a/test/integration/fixtures/blocks/core__cover__video-overlay.html +++ b/test/integration/fixtures/blocks/core__cover__video-overlay.html @@ -1,6 +1,6 @@ -
- +
+
diff --git a/test/integration/fixtures/blocks/core__cover__video-overlay.json b/test/integration/fixtures/blocks/core__cover__video-overlay.json index 01ca6fb5aaff3e..a9cc24589f4ae4 100644 --- a/test/integration/fixtures/blocks/core__cover__video-overlay.json +++ b/test/integration/fixtures/blocks/core__cover__video-overlay.json @@ -29,6 +29,6 @@ "originalContent": "

\n\t\t\tGuten Berg!\n\t\t

" } ], - "originalContent": "
\n\t\n\t\n\t
\n\t\t\n\t
\n
" + "originalContent": "
\n\t\n\t\n\t
\n\t\t\n\t
\n
" } ] diff --git a/test/integration/fixtures/blocks/core__cover__video-overlay.parsed.json b/test/integration/fixtures/blocks/core__cover__video-overlay.parsed.json index 28b0dc7d76a6be..00e871e84d25eb 100644 --- a/test/integration/fixtures/blocks/core__cover__video-overlay.parsed.json +++ b/test/integration/fixtures/blocks/core__cover__video-overlay.parsed.json @@ -22,9 +22,9 @@ ] } ], - "innerHTML": "\n
\n\t\n\t\n\t
\n\t\t\n\t
\n
\n", + "innerHTML": "\n
\n\t\n\t\n\t
\n\t\t\n\t
\n
\n", "innerContent": [ - "\n
\n\t\n\t\n\t
\n\t\t", + "\n
\n\t\n\t\n\t
\n\t\t", null, "\n\t
\n
\n" ] diff --git a/test/integration/fixtures/blocks/core__cover__video-overlay.serialized.html b/test/integration/fixtures/blocks/core__cover__video-overlay.serialized.html index 7bfd467e02af46..9115273d4bc625 100644 --- a/test/integration/fixtures/blocks/core__cover__video-overlay.serialized.html +++ b/test/integration/fixtures/blocks/core__cover__video-overlay.serialized.html @@ -1,5 +1,5 @@ -
+

Guten Berg!