Skip to content

Commit

Permalink
Media & Text Block: Fix frontend styles when "Crop image to fill" is …
Browse files Browse the repository at this point in the history
…selected (#20539)

* Fix selectors for frontend styles of media text block w/ "Crop image to fill" option active

* Rename editor container class and remove redundant block styles
  • Loading branch information
jffng authored Mar 3, 2020
1 parent 742dbf2 commit d63b737
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class MediaTextEdit extends Component {
} = attributes;
return (
<MediaContainer
className="wp-block-media-text__media-container"
className="wp-block-media-text__media"
onSelectMedia={ this.onSelectMedia }
onWidthChange={ this.onWidthChange }
commitWidthChange={ this.commitWidthChange }
Expand Down
12 changes: 0 additions & 12 deletions packages/block-library/src/media-text/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,6 @@
max-width: unset;
}

figure.wp-block-media-text__media-container {
margin: 0;
height: 100%;
width: 100%;
}

.wp-block-media-text .wp-block-media-text__media-container img,
.wp-block-media-text .wp-block-media-text__media-container video {
vertical-align: middle;
width: 100%;
}

.editor-media-container__resizer .components-resizable-box__handle {
display: none;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/block-library/src/media-text/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
vertical-align: middle;
}

.wp-block-media-text.is-image-fill figure.wp-block-media-text__media-container {
.wp-block-media-text.is-image-fill figure.wp-block-media-text__media {
height: 100%;
min-height: 250px;
background-size: cover;
}

.wp-block-media-text.is-image-fill figure.wp-block-media-text__media-container > img {
.wp-block-media-text.is-image-fill figure.wp-block-media-text__media > img {
// The image is visually hidden but accessible to assistive technologies.
position: absolute;
width: 1px;
Expand Down

0 comments on commit d63b737

Please sign in to comment.