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

Using viewheight for blocks in patterns creates weird previews #43865

Closed
Humanify-nl opened this issue Sep 5, 2022 · 1 comment
Closed

Using viewheight for blocks in patterns creates weird previews #43865

Humanify-nl opened this issue Sep 5, 2022 · 1 comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@Humanify-nl
Copy link

Humanify-nl commented Sep 5, 2022

Description

The Cover block is a good example of a block that makes good use of the viewheight unit.

In pattern previews (in the pattern sidebar, explorer or page creation modal) this creates a problem where things are not scaled accordingly and even weirdly so. This used to be workable. But in the page creation previews, this problem becomes a bit more prevalent.

Page creation modal is also less friendly, with displaying a disrupting flickering pattern for a page with a vh container in it. Using the * Viewport Width = 1920px in the file header removes the flickering, but the scale is still very off, especially compared to other patterns.

I think this is a bug, yet it behaves exactly as it should (it scales to vh / vw), but this is not usable in pattern previews when they are a bit more lengthy.

Step-by-step reproduction instructions

  1. Default TT2 theme.
  2. Create a cover block, set it to full width & 70vh (min-height), put something in it.
  3. Fill out the page (this is optional but to fully illustrate the problem, you need a whole page)
  4. Do copy all content and paste it in a page-pattern.php with default file-header and add * Block Types: core/post-content in the header.
  5. Go to admin, make new page, see creation modal open - see the preview of the pattern.
  6. To really feel the difference, copy the page, and replace the 700vh with pixel value, and compare the previews.

Screenshots, screen recording, code snippet

No response

Environment info

WordPress 6.0.1 (& 6.0.2)
No Gutenberg

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added the [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced label Sep 6, 2022
@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Sep 1, 2023
@youknowriad
Copy link
Contributor

closing this as a duplicate of #50449

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants