-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add min-width to audio block. (#11749)
* Add min-width to audio block. Fixes #11740. The audio block has no intrinsic width, and collapses if we don't set an explicit min-width on it. This PR does that. * Update changelog * Move to style.scss instead. * Refactor, address feedback.
- Loading branch information
1 parent
27bade3
commit 0b3e33c
Showing
3 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
.wp-block-audio { | ||
margin: 0; | ||
} | ||
|
||
.wp-block-audio audio { | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
.wp-block-audio figcaption { | ||
margin-top: 0.5em; | ||
color: $dark-gray-300; | ||
text-align: center; | ||
font-size: $default-font-size; | ||
.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%; | ||
|
||
// The browser natively applies a 300px width to the audio block. | ||
// We restore this as a min-width instead, for alignments. | ||
min-width: 300px; | ||
} | ||
} |