diff --git a/packages/block-library/src/image/style.scss b/packages/block-library/src/image/style.scss index e86aa7deef048..72ff28b93b67c 100644 --- a/packages/block-library/src/image/style.scss +++ b/packages/block-library/src/image/style.scss @@ -97,6 +97,42 @@ border-radius: 0; } } + + // The following is required to overcome WP Core applying styles that clear + // img borders with a higher specificity than those added by the border + // block support to provide a default border-style of solid when a border + // color or width has been set. + :where(.has-border-color) { + border-style: solid; + } + :where([style*="border-top-color"]) { + border-top-style: solid; + } + :where([style*="border-right-color"]) { + border-right-style: solid; + } + :where([style*="border-bottom-color"]) { + border-bottom-style: solid; + } + :where([style*="border-left-color"]) { + border-left-style: solid; + } + + :where([style*="border-width"]) { + border-style: solid; + } + :where([style*="border-top-width"]) { + border-top-style: solid; + } + :where([style*="border-right-width"]) { + border-right-style: solid; + } + :where([style*="border-bottom-width"]) { + border-bottom-style: solid; + } + :where([style*="border-left-width"]) { + border-left-style: solid; + } } .wp-block-image figure {