Skip to content

Commit

Permalink
Cover: Fix matrix alignment issue. (#28361)
Browse files Browse the repository at this point in the history
For context, position absolute, combined with width/height 100% works in most cases, but is still subject to the box model, collapsing margins, and other hard-to-predict things. By replacing those with top/right/bottom/left values of zero, we set neither widths nor heights, but accomplish the same.
  • Loading branch information
jasmussen authored Jan 20, 2021
1 parent 24f9973 commit 1796afc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/block-library/src/cover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@
.wp-block-cover__image-background,
.wp-block-cover__video-background {
position: absolute;
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
object-fit: cover;
}

Expand Down

0 comments on commit 1796afc

Please sign in to comment.