-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.block-editor-iframe__html { | ||
transform-origin: top center; | ||
transition: transform 0.3s; | ||
@include reduce-motion("transition"); | ||
} | ||
|
||
.block-editor-iframe__html.is-zoomed-out { | ||
$scale: var(--wp-zoom-out-scale); | ||
$frame-size: var(--wp-zoom-out-frame-size); | ||
$inner-height: var(--wp-zoom-out-inner-height); | ||
$content-height: var(--wp-zoom-out-content-height); | ||
|
||
transform: scale( #{$scale} ); | ||
|
||
background-color: $gray-300; | ||
|
||
// Firefox and Safari don't render margin-bottom here and margin-bottom is needed for Chrome | ||
// layout, so we use border matching the background instead of margins. | ||
border: calc( #{$frame-size} / #{$scale} ) solid $gray-300; | ||
|
||
// Chrome seems to respect that transform scale shouldn't affect the layout size of the element, | ||
// so we need to adjust the height of the content to match the scale by using negative margins. | ||
$extra-content-height: calc( #{$content-height} * (1 - #{$scale}) ); | ||
$total-frame-height: calc( 2 * #{$frame-size} ); | ||
$total-height: calc( #{$extra-content-height} + #{$total-frame-height} ); | ||
margin-bottom: calc( -1 * #{$total-height} ); | ||
|
||
body { | ||
min-height: calc( ( #{$inner-height} - #{$total-frame-height} ) / #{$scale} ); | ||
display: flex; | ||
flex-direction: column; | ||
|
||
> .is-root-container { | ||
flex: 1; | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
|
||
> main { | ||
flex: 1; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters