Skip to content
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

Set the scale() CSS property to the proper element for block pattern preview. #38543

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

ixkaito
Copy link
Contributor

@ixkaito ixkaito commented Feb 5, 2022

Description

Set the scale() CSS property to the proper element for block pattern preview.

Testing Instructions

Screenshots

Before and after

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).
  • I've updated related schemas if appropriate.
@ixkaito ixkaito mentioned this pull request Feb 5, 2022
8 tasks
@jasmussen jasmussen requested review from a team and noahtallen and removed request for a team February 8, 2022 08:31
@draganescu
Copy link
Contributor

I tested this but it's unclear to me what should happen with this changeset applied. I tested in Safari and preview__content seems to be the same in trunk.

@ixkaito
Copy link
Contributor Author

ixkaito commented Feb 8, 2022

There's no change on the screen because .block-editor-block-preview__content has an initial value visible for overflow, so its content is visible now. However, .block-editor-block-preview__content has a wrong size. Please check the size of .block-editor-block-preview__content in your browser inspector. It has 0px width and a smaller height than it's content. If you set overflow: hidden; to .block-editor-block-preview__content, its content will be invisible.

Why this is happening: For example, contentHeight is 100, and scale is 0.1. The height of .block-editor-block-preview__content would be 1px because the height is 100 * 0.1 and then transformed by scale(0.1), but it shouldn't. It should be 10px. What we have to scale is not the parent container but the child iframe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants