From 4cc22124703b32d48ce26c12cfd44dc3357fc23b Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Mon, 8 Mar 2021 15:05:40 +0100 Subject: [PATCH] Restore the margins of blocks relying on the figure element (#29517) * Restore the margins of blocks relying on the figure element * Remove margin bottom from the embed figure * Restore bottom margin for empty figure blocks --- packages/block-library/src/audio/style.scss | 2 ++ packages/block-library/src/embed/style.scss | 5 ++--- packages/block-library/src/image/style.scss | 4 +--- packages/block-library/src/pullquote/style.scss | 3 +-- packages/block-library/src/table/style.scss | 1 + packages/block-library/src/video/style.scss | 4 +--- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/block-library/src/audio/style.scss b/packages/block-library/src/audio/style.scss index 64d79cafd85dc9..5ae37a0b2b7adb 100644 --- a/packages/block-library/src/audio/style.scss +++ b/packages/block-library/src/audio/style.scss @@ -1,4 +1,6 @@ .wp-block-audio { + margin: 0 0 1em 0; + // Supply caption styles to audio blocks, even if the theme hasn't opted in. // Reason being: the new markup, , are not likely to be styled in the majority of existing themes, // so we supply the styles so as to not appear broken or unstyled in those themes. diff --git a/packages/block-library/src/embed/style.scss b/packages/block-library/src/embed/style.scss index 4099b1bda010f2..f416d1d73c80ec 100644 --- a/packages/block-library/src/embed/style.scss +++ b/packages/block-library/src/embed/style.scss @@ -20,15 +20,14 @@ } .wp-block-embed { + margin: 0 0 1em 0; + // Supply caption styles to embeds, even if the theme hasn't opted in. // Reason being: the new markup, figcaptions, are not likely to be styled in the majority of existing themes, // so we supply the styles so as to not appear broken or unstyled in those. figcaption { @include caption-style(); } - // The embed block is in a `figure` element, and many themes zero this out. - // This rule explicitly sets it, to ensure at least some bottom-margin in the flow. - margin-bottom: 1em; // Don't allow iframe to overflow it's container. iframe { diff --git a/packages/block-library/src/image/style.scss b/packages/block-library/src/image/style.scss index 2a887ef4898539..18697050abc2ee 100644 --- a/packages/block-library/src/image/style.scss +++ b/packages/block-library/src/image/style.scss @@ -1,7 +1,5 @@ .wp-block-image { - // The image block is in a `figure` element, and many themes zero this out. - // This rule explicitly sets it, to ensure at least some bottom-margin in the flow. - margin-bottom: 1em; + margin: 0 0 1em 0; img { max-width: 100%; diff --git a/packages/block-library/src/pullquote/style.scss b/packages/block-library/src/pullquote/style.scss index 61b9ce061c7b3f..7a260d0dff26fc 100644 --- a/packages/block-library/src/pullquote/style.scss +++ b/packages/block-library/src/pullquote/style.scss @@ -1,7 +1,6 @@ .wp-block-pullquote { + margin: 0 0 1em 0; padding: 3em 0; - margin-left: 0; - margin-right: 0; text-align: center; &.alignleft, diff --git a/packages/block-library/src/table/style.scss b/packages/block-library/src/table/style.scss index cdbabd74455378..0a18b92b5b8d4e 100644 --- a/packages/block-library/src/table/style.scss +++ b/packages/block-library/src/table/style.scss @@ -1,4 +1,5 @@ .wp-block-table { + margin: 0 0 1em 0; $subtle-light-gray: #f3f4f5; $subtle-pale-green: #e9fbe5; $subtle-pale-blue: #e7f5fe; diff --git a/packages/block-library/src/video/style.scss b/packages/block-library/src/video/style.scss index 0735f6bfe8035c..4a91c07fee90fe 100644 --- a/packages/block-library/src/video/style.scss +++ b/packages/block-library/src/video/style.scss @@ -1,7 +1,5 @@ .wp-block-video { - // Remove the left and right margin the figure is born with. - margin-left: 0; - margin-right: 0; + margin: 0 0 1em 0; video { width: 100%;