Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default overlay color to black #59894

Draft
wants to merge 4 commits into
base: trunk
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/block-library/src/cover/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"default": 100
},
"overlayColor": {
"type": "string"
"type": "string",
"default": "black"
},
"customOverlayColor": {
"type": "string"
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/blocks/core__cover.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"isValid": true,
"attributes": {
"url": "data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=",
"useFeaturedImage": false,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 40,
"backgroundType": "image",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "core/cover",
"isValid": true,
"isValid": false,
"attributes": {
"url": "https://w.wiki/59So",
"useFeaturedImage": false,
Expand All @@ -10,6 +10,7 @@
"hasParallax": true,
"isRepeated": false,
"dimRatio": 50,
"overlayColor": "black",
"backgroundType": "image",
"isDark": false,
"tagName": "div",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- wp:cover {"url":"https://w.wiki/59So","id":612,"alt":"Custom alt text","hasParallax":true,"dimRatio":50,"isDark":false,"layout":{"type":"constrained"}} -->
<div class="wp-block-cover is-light has-parallax"><span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span><div role="img" aria-label="Custom alt text" class="wp-block-cover__image-background wp-image-612 has-parallax" style="background-position:50% 50%;background-image:url(https://w.wiki/59So)"></div><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
<div class="wp-block-cover is-light has-parallax"><span aria-hidden="true" class="wp-block-cover__background has-background-dim"></span><div role="img" aria-label="Custom alt text" class="wp-block-cover__image-background wp-image-612 has-parallax" style="background-position:50% 50%;background-image:url(https://w.wiki/59So)"></div><div class="wp-block-cover__inner-container">
<!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:paragraph -->
</div></div>
<!-- /wp:cover -->
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"isValid": true,
"attributes": {
"url": "https://w.wiki/59Sd",
"useFeaturedImage": false,
"id": 609,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 50,
"backgroundType": "image",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "core/cover",
"isValid": true,
"isValid": false,
"attributes": {
"url": "https://w.wiki/59So",
"useFeaturedImage": false,
Expand All @@ -10,6 +10,7 @@
"hasParallax": true,
"isRepeated": true,
"dimRatio": 10,
"overlayColor": "black",
"backgroundType": "image",
"isDark": false,
"tagName": "div",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<!-- wp:cover {"url":"https://w.wiki/59So","id":612,"hasParallax":true,"isRepeated":true,"dimRatio":10,"isDark":false,"style":{"color":{"duotone":["#8c00b7","#fcff41"]}}} -->
<div class="wp-block-cover is-light has-parallax is-repeated"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-10 has-background-dim"></span><div class="wp-block-cover__image-background wp-image-612 has-parallax is-repeated" style="background-position:50% 50%;background-image:url(https://w.wiki/59So)"></div><div class="wp-block-cover__inner-container"><!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
<div class="wp-block-cover is-light has-parallax is-repeated"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-10 has-background-dim"></span><div class="wp-block-cover__image-background wp-image-612 has-parallax is-repeated" style="background-position:50% 50%;background-image:url(https://w.wiki/59So)"></div><div class="wp-block-cover__inner-container">
<!-- wp:paragraph {"align":"center","placeholder":"Write title…","fontSize":"large"} -->
<p class="has-text-align-center has-large-font-size"></p>
<!-- /wp:paragraph --></div></div>
<!-- /wp:paragraph -->
</div></div>
<!-- /wp:cover -->
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"name": "core/cover",
"isValid": true,
"attributes": {
"useFeaturedImage": false,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 100,
"backgroundType": "image",
"customGradient": "linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"isValid": true,
"attributes": {
"url": "data:image/jpeg;base64,/9j/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/yQALCAABAAEBAREA/8wABgAQEAX/2gAIAQEAAD8A0s8g/9k=",
"useFeaturedImage": false,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 30,
"backgroundType": "image",
"customGradient": "linear-gradient(135deg,rgba(0,208,132,1) 0%,rgba(6,147,227,1) 100%)",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Original file line number Diff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Ratio": 70,
"backgroundType": "video",
"customGradient": "linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"name": "core/cover",
"isValid": true,
"attributes": {
"useFeaturedImage": false,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 100,
"backgroundType": "image",
"gradient": "luminous-dusk",
"isDark": false,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
2 changes: 1 addition & 1 deletion test/integration/fixtures/blocks/core__cover__video.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"isValid": true,
"attributes": {
"url": "data:video/mp4;base64,AAAAHGZ0eXBpc29tAAACAGlzb21pc28ybXA0MQAAAAhmcmVlAAAC721kYXQhEAUgpBv/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA3pwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcCEQBSCkG//AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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kcwAAAAADgICAIgACAASAgIAUQBUAAAAAAfQAAAHz+QWAgIACEhAGgICAAQIAAAAYc3R0cwAAAAAAAAABAAAAAgAABAAAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAIAAAABAAAAHHN0c3oAAAAAAAAAAAAAAAIAAAFzAAABdAAAABRzdGNvAAAAAAAAAAEAAAAsAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=",
"useFeaturedImage": false,
"alt": "",
"hasParallax": false,
"isRepeated": false,
"dimRatio": 40,
"backgroundType": "video",
"isDark": true,
"useFeaturedImage": false,
"tagName": "div"
},
"innerBlocks": [
Expand Down
Loading