-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow customization of block preview height #60990
Comments
cc @t-hamano as you worked on that prior PR! |
Thanks for the report. #59112 is meant to fix bugs that were originally not working as expected. Additionally, the height applied to the preview is a minimum value rather than a fixed value. Are there any steps to reproduce this problem? |
It does not appear to be applied as a minimum value.
I am using Firefox 125.0.2 on Ubuntu 23.10. WordPress 6.4.2: WordPress 6.5.2: |
I traced the issue to having this in my theme's editor stylesheet: body {
height: 100%;
} (More specifically, this was set for the front-end and included in the editor stylesheet.) I assume the preview component is setting the iframe height based on the height of the |
Could you tell me how this style is enqueued? If we can reproduce this problem in our environment, we may be able to decide whether to solve this problem with Gutenberg. |
My theme is a classic theme, the editor stylesheet is enqueued with: function after_setup_theme_editor_style() {
add_editor_style();
}
add_action( 'after_setup_theme', 'after_setup_theme_editor_style' ); The stylesheets are written with Sass, and the editor stylesheet includes most of the styles from the front-end stylesheet as the theme also has some custom blocks. |
I tested it with Twenty Twenty-One, but I can't reproduce it. (Regardless of whether Gutenberrg plugin is enabled) I added As the screenshot shows, the body element inside the preview iframe has |
For me the Edit: I made the same edit to Twenty Twenty-One and I see the issue (and |
I was able to reproduce this problem. In order to reproduce this issue, the block editor must be non-iframed. That is, if you have a custom field enabled or a block registered with apiVersion 2. However, this issue should not be caused by #59112. This is because #59112 makes changes to the |
When I went back through the commit history, I found that this problem occurred in #57810. I also provide detailed reproduction steps. Steps
✅ Before #57810 is merged (commit hash: f6d29bd)The ❌ Right after #57810 is merged (commit hash: 45eb9a5)The |
What problem does this address?
Before WordPress 6.5, the block preview height was not fixed, instead adapting to the height of the preview content. After 6.5, the block preview height appears to be fixed to 150px, I believe as a result of #59112.
150px is not tall enough for many (most?) blocks, but more importantly, any single fixed height will not work for all blocks.
What is your proposed solution?
Support either one or (ideally) both:
viewportWidth
.The text was updated successfully, but these errors were encountered: