diff --git a/packages/block-editor/src/components/iframe/content.scss b/packages/block-editor/src/components/iframe/content.scss index d33ed7818aa2a8..1d01f84b5fd1fd 100644 --- a/packages/block-editor/src/components/iframe/content.scss +++ b/packages/block-editor/src/components/iframe/content.scss @@ -23,10 +23,10 @@ $frame-size: var(--wp-block-editor-iframe-zoom-out-frame-size); $inner-height: var(--wp-block-editor-iframe-zoom-out-inner-height); $content-height: var(--wp-block-editor-iframe-zoom-out-content-height); - $outer-container-width: var(--wp-block-editor-iframe-zoom-out-outer-container-width); + $scale-container-width: var(--wp-block-editor-iframe-zoom-out-scale-container-width); $container-width: var(--wp-block-editor-iframe-zoom-out-container-width, 100vw); // Apply an X translation to center the scaled content within the available space. - transform: translateX(calc((#{$outer-container-width} - #{$container-width}) / 2 / #{$scale})); + transform: translateX(calc((#{$scale-container-width} - #{$container-width}) / 2 / #{$scale})); scale: #{$scale}; background-color: $gray-300; diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index ee83176c2aeaf3..b14514f934fb3e 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -247,7 +247,7 @@ function Iframe( { } }, [ containerWidth, isZoomedOut ] ); - const outerContainerWidth = Math.max( + const scaleContainerWidth = Math.max( initialContainerWidth.current, containerWidth ); @@ -357,7 +357,7 @@ function Iframe( { scale === 'default' ? ( Math.min( containerWidth, maxWidth ) - parseInt( frameSize ) * 2 ) / - outerContainerWidth + scaleContainerWidth : scale ); @@ -379,8 +379,8 @@ function Iframe( { `${ containerWidth }px` ); iframeDocument.documentElement.style.setProperty( - '--wp-block-editor-iframe-zoom-out-outer-container-width', - `${ outerContainerWidth }px` + '--wp-block-editor-iframe-zoom-out-scale-container-width', + `${ scaleContainerWidth }px` ); return () => { @@ -400,7 +400,7 @@ function Iframe( { '--wp-block-editor-iframe-zoom-out-container-width' ); iframeDocument.documentElement.style.removeProperty( - '--wp-block-editor-iframe-zoom-out-outer-container-width' + '--wp-block-editor-iframe-zoom-out-scale-container-width' ); }; }, [ @@ -412,7 +412,7 @@ function Iframe( { containerWidth, windowInnerWidth, isZoomedOut, - outerContainerWidth, + scaleContainerWidth, ] ); // Make sure to not render the before and after focusable div elements in view @@ -502,8 +502,8 @@ function Iframe( { isZoomedOut && 'is-zoomed-out' ) } style={ { - '--wp-block-editor-iframe-zoom-out-outer-container-width': - isZoomedOut && `${ outerContainerWidth }px`, + '--wp-block-editor-iframe-zoom-out-scale-container-width': + isZoomedOut && `${ scaleContainerWidth }px`, } } > { iframe } diff --git a/packages/block-editor/src/components/iframe/style.scss b/packages/block-editor/src/components/iframe/style.scss index d05be2f3977b9f..5dd30c338057e2 100644 --- a/packages/block-editor/src/components/iframe/style.scss +++ b/packages/block-editor/src/components/iframe/style.scss @@ -9,8 +9,8 @@ } .block-editor-iframe__scale-container.is-zoomed-out { - $outer-container-width: var(--wp-block-editor-iframe-zoom-out-outer-container-width, 100vw); - width: $outer-container-width; + $scale-container-width: var(--wp-block-editor-iframe-zoom-out-scale-container-width, 100vw); + width: $scale-container-width; // Position the iframe so that it is always aligned with the right side so that // the scrollbar is always visible on the right side position: absolute;