Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix issue with editor styles and fullscreen #10024
This is a curious one.
The topbar in WordPress takes up some space in the editing canvas. When fullscreen mode is engaged, we invoke a negative vertical margin to offset this. But this means the body element is no longer 100% tall, because 32px have been cropped off.
So what happens when an editor style colorizes the body element? Well normally even though the body element isn't as tall as the viewport, it floods the whole thing. See https://css-tricks.com/just-one-of-those-weird-things-about-css-background-on-body/ for all the details.
But in this case, we have a background color on the HTML element. And we need to have that, because otherwise we can't use mix-blend-mode when selecting multiple blocks. This is due to a bug in Chrome where this feature doesn't work unless a background color that isn't none or transparent is explicitly set on the html element.
So there we go — and that's why this PR uses calc to set the height on the body element.