diff --git a/packages/block-library/src/audio/theme.scss b/packages/block-library/src/audio/theme.scss index 2744d36e74ca6..eda394fd6a3d5 100644 --- a/packages/block-library/src/audio/theme.scss +++ b/packages/block-library/src/audio/theme.scss @@ -2,6 +2,6 @@ @include caption-style-theme(); } -.wp-block-audio { +:where(.wp-block-audio) { margin: 0 0 1em 0; } diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index 837e3834e2e1b..d14f606fc0226 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -1,12 +1,16 @@ +// Lowest specificity styles are used to ensure that the default styles for the cover block can be overridden by global styles. +:where(.wp-block-cover-image, .wp-block-cover) { + min-height: 430px; + padding: 1em; +} + .wp-block-cover-image, .wp-block-cover { position: relative; background-position: center center; - min-height: 430px; display: flex; justify-content: center; align-items: center; - padding: 1em; // Prevent the `wp-block-cover__background` span from overflowing the container when border-radius is applied. // `overflow: hidden` is provided as a fallback for browsers that don't support `overflow: clip`. overflow: hidden; diff --git a/packages/block-library/src/embed/theme.scss b/packages/block-library/src/embed/theme.scss index e809a783b9c81..57ece1dcd43ca 100644 --- a/packages/block-library/src/embed/theme.scss +++ b/packages/block-library/src/embed/theme.scss @@ -2,6 +2,6 @@ @include caption-style-theme(); } -.wp-block-embed { +:where(.wp-block-embed) { margin: 0 0 1em 0; } diff --git a/packages/block-library/src/image/theme.scss b/packages/block-library/src/image/theme.scss index d5b2cfb0e83e9..459036511335a 100644 --- a/packages/block-library/src/image/theme.scss +++ b/packages/block-library/src/image/theme.scss @@ -2,6 +2,6 @@ @include caption-style-theme(); } -.wp-block-image { +:where(.wp-block-image) { margin: 0 0 1em 0; } diff --git a/packages/block-library/src/pullquote/theme.scss b/packages/block-library/src/pullquote/theme.scss index 6b5e8401227f5..0dc7943a77051 100644 --- a/packages/block-library/src/pullquote/theme.scss +++ b/packages/block-library/src/pullquote/theme.scss @@ -1,9 +1,11 @@ -.wp-block-pullquote { +:where(.wp-block-pullquote) { border-top: 4px solid currentColor; border-bottom: 4px solid currentColor; margin-bottom: 1.75em; color: currentColor; +} +.wp-block-pullquote { cite, footer, &__citation { diff --git a/packages/block-library/src/quote/theme.scss b/packages/block-library/src/quote/theme.scss index 085d4e91924a8..aaf63b899771b 100644 --- a/packages/block-library/src/quote/theme.scss +++ b/packages/block-library/src/quote/theme.scss @@ -1,8 +1,7 @@ -.wp-block-quote { +:where(.wp-block-quote) { border-left: 0.25em solid currentColor; margin: 0 0 1.75em 0; padding-left: 1em; - cite, footer { color: currentColor; diff --git a/packages/block-library/src/social-links/editor.scss b/packages/block-library/src/social-links/editor.scss index 4ba574c965d2d..f3b8908c1ae95 100644 --- a/packages/block-library/src/social-links/editor.scss +++ b/packages/block-library/src/social-links/editor.scss @@ -4,13 +4,6 @@ display: inline-block; margin-left: $grid-unit-10; } - - // Unset background colors that can be inherited from Global Styles. - // This is a duplicate of a rule in style.scss, as it needs higher specificity in the editor. - // The rule can be removed if editor styles get lowered in specificity. - &.wp-block-social-links { - background: none; - } } // Prevent toolbar from jumping when selecting / hovering a link. diff --git a/packages/block-library/src/table/theme.scss b/packages/block-library/src/table/theme.scss index d42e79b02b496..19dc71c8857bd 100644 --- a/packages/block-library/src/table/theme.scss +++ b/packages/block-library/src/table/theme.scss @@ -1,6 +1,4 @@ .wp-block-table { - margin: 0 0 1em 0; - td, th { word-break: normal; @@ -10,3 +8,7 @@ @include caption-style-theme(); } } + +:where(.wp-block-table) { + margin: 0 0 1em 0; +} diff --git a/packages/block-library/src/template-part/theme.scss b/packages/block-library/src/template-part/theme.scss index 58e7b1fdf2d9f..2f1d3a0a513cb 100644 --- a/packages/block-library/src/template-part/theme.scss +++ b/packages/block-library/src/template-part/theme.scss @@ -1,5 +1,5 @@ // Same as the group block styles. -.wp-block-template-part { +:where(.wp-block-template-part) { &.has-background { // Matches paragraph Block padding padding: $block-bg-padding--v $block-bg-padding--h; diff --git a/packages/block-library/src/video/theme.scss b/packages/block-library/src/video/theme.scss index cdc95af0b02c2..c5399582bbb28 100644 --- a/packages/block-library/src/video/theme.scss +++ b/packages/block-library/src/video/theme.scss @@ -2,6 +2,6 @@ @include caption-style-theme(); } -.wp-block-video { +:where(.wp-block-video) { margin: 0 0 1em 0; }