-
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
Site Editor: Fix gradient background color repeats #51374
Conversation
Size Change: +7 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
Flaky tests detected in a6f0c0e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5221992164
|
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.
Excellent catch, thanks for doing that. The min-height is a common trick for these situations and will likely help with issues around position fixed in the future as well, and some other single page layouts.
I would appreciate another quick code sanity check before you merge. |
I feel we've been going back and forth on some of these things but I can't break this in any way so LGTM too. |
Sorry to come back to this. While testing background styles over in #59354 (comment), it became apparent that having a min-height on the For example, the repeating background will still occur on the frontend despite the editor rule: It's not such a big deal I guess, but it more apparent when the background is an image. How closely do we want the site editor and frontend to match? |
I think we want them to match as closely as possible. If this is considered a bug in the editor, it should be considered a bug in the frontend too. |
Thanks, there's a discussion over in #59354 (comment) about adding a min-height by default on |
Fixes: #46782
What?
This PR fixes a problem in the site editor where the background gradient repeats when the content is less than the height of the canvas.
Why?
I have created some simple HTML to try to figure out the cause of this problem.
The height of the
body
element is 100px. And the same goes forhtml
elements. However, when you define a background color on thebody
element, that background goes beyond thehtml
element and fills the entire page.This behavior does not occur with any element within the body element. I have also observed this problem in both Chrome and Firefox.
How?
I found that this problem does not occur when the
html
element is above the document height. Therefore, I addedmin-height:100%
.Testing Instructions
Screenshots or screencast