Skip to content

Commit

Permalink
Restore default Cover overlay background
Browse files Browse the repository at this point in the history
The default Cover block overlay background was removed. This changed the
style of existing blocks on existing sites.

Restore the default background in such a way that it does not conflict
with theme-provided background-color styles and there is no need to
artificially add extra specificity.

Fix regression: #26545
  • Loading branch information
sirreal committed Oct 29, 2020
1 parent eaf00bd commit dda0568
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/block-library/src/cover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@
background-size: auto;
}

/**
* Set a default background color for has-background-dim _unless_ it includes another
* background-color class (e.g. has-green-background-color). The presence of another
* background-color class implies that another style will provide the background color
* for the overlay.
*
* See:
* - Issue with background color specificity: https://github.com/WordPress/gutenberg/issues/26545
* - Issue with alternative fix: https://github.com/WordPress/gutenberg/issues/26545
*/
&.has-background-dim:not([class*="-background-color"]) {
background-color: $black;
}

&.has-background-dim::before {
content: "";
background-color: inherit;
Expand Down

0 comments on commit dda0568

Please sign in to comment.