diff --git a/assets/stylesheets/_mixins.scss b/assets/stylesheets/_mixins.scss index 39fa453be4e2f..35667a3f10841 100644 --- a/assets/stylesheets/_mixins.scss +++ b/assets/stylesheets/_mixins.scss @@ -310,17 +310,11 @@ * Styles that are reused verbatim in a few places */ -// These are base styles for all captions. -@mixin caption-style() { - margin-top: 0.5em; - margin-bottom: 1em; - text-align: center; -} - // These are additional styles for all captions, when the theme opts in to block styles. @mixin caption-style-theme() { color: $dark-gray-500; font-size: $default-font-size; + text-align: center; } @mixin dropdown-arrow() { diff --git a/packages/block-library/src/audio/style.scss b/packages/block-library/src/audio/style.scss index 64d79cafd85dc..4bec2b8522538 100644 --- a/packages/block-library/src/audio/style.scss +++ b/packages/block-library/src/audio/style.scss @@ -1,11 +1,4 @@ .wp-block-audio { - // 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. - figcaption { - @include caption-style(); - } - // Show full-width when not aligned. audio { width: 100%; diff --git a/packages/block-library/src/embed/style.scss b/packages/block-library/src/embed/style.scss index dd636b47eb619..e6ccaf5d388e1 100644 --- a/packages/block-library/src/embed/style.scss +++ b/packages/block-library/src/embed/style.scss @@ -9,12 +9,6 @@ } .wp-block-embed { - // 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; diff --git a/packages/block-library/src/image/style.scss b/packages/block-library/src/image/style.scss index 01c3585be4a1f..0ce4d929d426d 100644 --- a/packages/block-library/src/image/style.scss +++ b/packages/block-library/src/image/style.scss @@ -58,11 +58,4 @@ margin-left: auto; margin-right: auto; } - - // Supply caption styles to images, 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. - figcaption { - @include caption-style(); - } } diff --git a/packages/block-library/src/video/style.scss b/packages/block-library/src/video/style.scss index de4e9499dd67c..e426eaa6e2f70 100644 --- a/packages/block-library/src/video/style.scss +++ b/packages/block-library/src/video/style.scss @@ -16,11 +16,4 @@ &.aligncenter { text-align: center; } - - // Supply caption styles to videos, 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. - figcaption { - @include caption-style(); - } } diff --git a/packages/editor/src/editor-styles.scss b/packages/editor/src/editor-styles.scss index 1efafd9445f49..8d2140bce8a3a 100644 --- a/packages/editor/src/editor-styles.scss +++ b/packages/editor/src/editor-styles.scss @@ -33,3 +33,11 @@ ul ul, ol ul { list-style-type: circle; } + +// Supply caption styles even if the theme hasn't opted in. +// Reason being: the figcaption element is 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. +figcaption { + margin-top: 0.5em; + margin-bottom: 1em; +}