-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cover matrix alignment #28404
Fix cover matrix alignment #28404
Changes from all commits
e9e1ab8
729d653
8b698ab
ad72dcf
e4dee72
2543962
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -5,7 +5,6 @@ | |||||||||||
background-position: center center; | ||||||||||||
min-height: 430px; | ||||||||||||
width: 100%; | ||||||||||||
height: 100%; // This explicit height rule is necessary for the focal point picker to work. | ||||||||||||
display: flex; | ||||||||||||
justify-content: center; | ||||||||||||
align-items: center; | ||||||||||||
|
@@ -167,14 +166,26 @@ | |||||||||||
width: auto; | ||||||||||||
} | ||||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
.wp-block-cover__image-background, | ||||||||||||
.wp-block-cover__video-background { | ||||||||||||
position: absolute; | ||||||||||||
width: 100%; | ||||||||||||
height: 100%; | ||||||||||||
object-fit: cover; | ||||||||||||
// Extra specificity for in edit mode where other styles would override it otherwise. | ||||||||||||
img.wp-block-cover__image-background, | ||||||||||||
video.wp-block-cover__video-background { | ||||||||||||
Comment on lines
+170
to
+172
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need the
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It wasn't working for me without it, unfortunately. Without it, the specificity is the same and these styles don't get applied. edit: for the record, the selector that I needed to override was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the extra specificity is only needed in the editor, I could duplicate these styles in edit.scss with the extra specificity and move these out to where they were before. But, I figured it would be better to avoid duplication between edit and save wherever possible. |
||||||||||||
position: absolute; | ||||||||||||
top: 0; | ||||||||||||
left: 0; | ||||||||||||
right: 0; | ||||||||||||
bottom: 0; | ||||||||||||
margin: 0; | ||||||||||||
padding: 0; | ||||||||||||
width: 100%; | ||||||||||||
height: 100%; | ||||||||||||
max-width: none; | ||||||||||||
max-height: none; | ||||||||||||
object-fit: cover; | ||||||||||||
outline: none; | ||||||||||||
border: none; | ||||||||||||
box-shadow: none; | ||||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
.wp-block-cover__video-background { | ||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rule was moved from style.scss to editor.scss, which makes me nervous. In general, unless it's explicitly for block editor specific shenanigans, like extra divs, adjacent markup, or visuals that appear only in the editor, my instinct is to keep as much of the CSS as possible in style.scss. That way any visual issues you fix on the frontend, you also fix in the editor.
I might move this back, but I need to test a little bit more first.