Skip to content

Commit

Permalink
Add comment about why the calculation for scaling needs to happen in …
Browse files Browse the repository at this point in the history
…the JS
  • Loading branch information
jeryj committed Oct 10, 2024
1 parent c70f39a commit a444cdb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ function Iframe( {
iframeDocument.documentElement.classList.add( 'is-zoomed-out' );

const maxWidth = 750;
// This scaling calculation has to happen within the JS because CSS calc() can
// only divide and multiply by a unitless value. I.e. calc( 100px / 2 ) is valid
// but calc( 100px / 2px ) is not.
iframeDocument.documentElement.style.setProperty(
'--wp-block-editor-iframe-zoom-out-scale',
scale === 'default'
Expand Down

0 comments on commit a444cdb

Please sign in to comment.