-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 zoom out UI scale #61265
Fix zoom out UI scale #61265
Conversation
Conflicts: packages/block-editor/src/components/block-list/content.scss packages/block-editor/src/components/iframe/index.js
Size Change: +141 B (+0.01%) Total Size: 1.74 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -1,7 +1,7 @@ | |||
.edit-site-code-editor { | |||
position: relative; | |||
width: 100%; | |||
min-height: 100%; |
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.
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.
LGTM pending on Ben's comments
|
||
.block-editor-iframe__html.is-zoomed-out { | ||
$scale: var(--wp-zoom-out-scale); | ||
$frame-size: var(--wp-zoom-out-frame-size); |
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.
Why did you move everything to CSS? We only need --wp-zoom-out-scale
?
This is going to be problematic when I try to animate both scroll and scale in JS at the same time with the same function.
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.
Or I wonder if animating these variables will be the same in terms of performance. But still, I don't get why we make all of these variables if it's not needed.
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.
We might also want to prefix it with wp-block-editor
, not sure
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.
Or I wonder if animating these variables will be the same in terms of performance. But still, I don't get why we make all of these variables if it's not needed.
It was easier to read. I would expect the styling to be done in CSS. And it seemed like performance wouldn't be worse.
This is going to be problematic when I try to animate both scroll and scale in JS at the same time with the same function.
Why do you need to animate them in JS? Can't the animations be done with CSS?
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.
Would love if we can only do the minimum needed changes
.block-editor-block-list__block.has-block-overlay::before { | ||
left: 0; | ||
right: 0; | ||
width: auto; |
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.
Why are we changing these rules?
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.
It provides exact sizing instead of using the hack that is sometimes wrong.
// TODO: `marginBottom` doesn't work in Firefox. We need another way | ||
// to do this. | ||
documentElement.style.marginBottom = `${ bottomFrameSize }px`; | ||
if ( iframeWindowInnerHeight > contentHeight * scale ) { |
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.
Let's see in a follow-up if this is still needed
What?
Fixes some UI issues in zoom-out mode such as bottom padding in Firefox and scale of the border in zoom out mode.
Why?
Bug fix
How?
Moves calculations into CSS where we can take advantage of the layout engine to simplify some calculations.
Also moved the iframe css to the iframe component instead of block-list.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast