Skip to content

Commit

Permalink
Constrain media blocks to content area width in frontend. (#8399)
Browse files Browse the repository at this point in the history
Giving a max-width of 100% to the image and video blocks ensures
they won't break out of the content area of the site, regardless of
whether the theme has styling that prevents overflow.

Fixes #8334.
  • Loading branch information
sarahmonster authored Aug 3, 2018
1 parent 0c12b15 commit b08f9d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core-blocks/image/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
.wp-block-image {
width: fit-content;
max-width: 100%;

img {
max-width: 100%;
}

&.aligncenter {
display: block;
Expand Down
4 changes: 4 additions & 0 deletions core-blocks/video/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.wp-block-video {
video {
max-width: 100%;
}

&.aligncenter {
text-align: center;
}
Expand Down

0 comments on commit b08f9d3

Please sign in to comment.