Skip to content

Commit c34cda4

Browse files
Add border support to the cover block
1 parent 1fe2cdf commit c34cda4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

packages/block-library/src/cover/block.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"spacing": {
5858
"padding": true
5959
},
60+
"__experimentalBorder": true,
6061
"color": {
6162
"__experimentalDuotone": "> .wp-block-cover__image-background, > .wp-block-cover__video-background",
6263
"text": false,

packages/block-library/src/cover/style.scss

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
padding: 1em;
1212
// This block has customizable padding, border-box makes that more predictable.
1313
box-sizing: border-box;
14+
// Overflow is hidden to handle border radius being applied on the block wrapper.
15+
overflow: hidden;
1416

1517
&.has-parallax {
1618
background-attachment: fixed;
@@ -39,11 +41,15 @@
3941
* background-color class implies that another style will provide the background color
4042
* for the overlay.
4143
*
44+
* The default background color has been moved to the before pseudo element
45+
* to allow custom border styles. If left on the `.has-background-dim`
46+
* element the color acts as a background to the dotted/dashed borders.
47+
*
4248
* See:
4349
* - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545
4450
* - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545
4551
*/
46-
&.has-background-dim:not([class*="-background-color"]) {
52+
&.has-background-dim:not([class*="-background-color"])::before {
4753
background-color: $black;
4854
}
4955

0 commit comments

Comments
 (0)