Skip to content

Commit

Permalink
Address feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen committed Mar 12, 2019
1 parent 50d4876 commit 0666ad8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 34 deletions.
8 changes: 1 addition & 7 deletions assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
7 changes: 0 additions & 7 deletions packages/block-library/src/audio/style.scss
Original file line number Diff line number Diff line change
@@ -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, <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 themes.
figcaption {
@include caption-style();
}

// Show full-width when not aligned.
audio {
width: 100%;
Expand Down
6 changes: 0 additions & 6 deletions packages/block-library/src/embed/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions packages/block-library/src/image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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, <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 themes.
figcaption {
@include caption-style();
}
}
7 changes: 0 additions & 7 deletions packages/block-library/src/video/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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, <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 themes.
figcaption {
@include caption-style();
}
}
8 changes: 8 additions & 0 deletions packages/editor/src/editor-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 0666ad8

Please sign in to comment.