From 0666ad8ae774f47ba149261e4c474ce16f051eeb Mon Sep 17 00:00:00 2001 From: jasmussen Date: Tue, 12 Mar 2019 09:12:16 +0100 Subject: [PATCH] Address feedback. --- assets/stylesheets/_mixins.scss | 8 +------- packages/block-library/src/audio/style.scss | 7 ------- packages/block-library/src/embed/style.scss | 6 ------ packages/block-library/src/image/style.scss | 7 ------- packages/block-library/src/video/style.scss | 7 ------- packages/editor/src/editor-styles.scss | 8 ++++++++ 6 files changed, 9 insertions(+), 34 deletions(-) diff --git a/assets/stylesheets/_mixins.scss b/assets/stylesheets/_mixins.scss index 39fa453be4e2f4..35667a3f108415 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 64d79cafd85dc9..4bec2b85225387 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 dd636b47eb619f..e6ccaf5d388e16 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 01c3585be4a1fc..0ce4d929d426dc 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 de4e9499dd67c5..e426eaa6e2f70e 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 1efafd9445f49a..8d2140bce8a3ab 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; +}