-
Notifications
You must be signed in to change notification settings - Fork 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
Layouts: Block previews contain unexpected amount of blank space #39355
Comments
Possibly solved by the iframe preview, as media queries will have a better match |
I've dug into this a bit to see if the iframe PR (#39628) will fix this.
That said, here's what I've found to be the specific issue with the extra blank spaces:
|
@jeryj Thanks for your research here. Can I confirm the following:
If so then I'd suggest this issue is actually better raised:
Thanks again |
Here's a screenshot of 2020 with the about page template on the front-end. You can see the large spacing is present:
The 2020 theme above on the front-end also does not contain margin-bottom/top on the spacer, but still has large gaps. The issue there is that 2020 applies margins to groups and Varia based themes must have a spacer between groups. Here's a screenshot of Varia on the front-end with the about page template when the spacers are removed from the template: Compare this same page (spacers removed) to the 2020 front-end. Spacing looks good when spacers are entirely removed, since the margins are handled by the groupings automatically: So we have a couple issues we're fixing for now:
Here's a screenshot of the spacer top/bottom margins set to 0 in the SPT preview: Still not so great :/ Here's a screenshot with the spacers removed entirely from DOM in the SPT preview: Now it looks right 👍 So, in the end, it may be best to change the about template to not use spacers. It may open a can of worms, but it may be good to also fix Varia based theme CSS so that spacers are not needed to get a nice looking template layout when using grouped blocks. cc @getdave |
Quick follow up. I had previously said:
I tried this, and, because of collapsing margins, setting the margins to 0 does not actually do anything. The previews still have the same amount of spacing. |
Thanks @jeryj . Interesting I've been working on trying to get dimensions (spacing) controls added to the Group Block in Core for a while now with little success. The main issue seems to be we can't decide how it should work on Themes that rely on spacer blocks. |
@ianstewart @iamtakashi What's your preferred way to handle this? |
In terms of vertical spacing, I don't see drastic differences between what I see in the preview and the editor with Varia based themes. In my opinion, the editor should show the content as close as possible to the front-end of the site, and I think that the editor styles in Varia based themes need to be improved. |
There is a Varia based theme issue that should make this situation better. (it won't still make 1:1, but better.) |
I think those Varia changes will help, but I think a change to the master template would be a good as well. My reason for recommending a template change is that Twenty Twenty experiences a similar large spacing, but it's consistent across preview, editor, and front-end: Because of this, it seems like it'd be good to tweak the master template to display more consistently across Twenty Twenty and Varia-based themes. |
That's ideal, but unfortunately, it's impossible to make the layouts work consistently in both Twenty Twenty and Varia-based themes as they handle spacing differently, and it's going to be disruptive for all the existing sites to change how Varia based themes handle spacing like Twenty Twenty. This problem illustrates one of the reasons why we should move on to offering Block patterns — more smaller chunks of a page, and let the user decide the spacing between the patterns. |
@ianstewart @iamtakashi In the meantime, how should this issue be handled? |
I think, at this point, this issue is more of Varia's editor-style issue, not a preview issue because the preview matches with the editor. |
I'll close this one and we can move it to a Themes discussion. |
Many of the previews in our Layout Selector have unexpected gaps in the preview that do not reflect the final output.
For example this About template …
Compared to the final output on the front-end of the site …
Enhancement: Provide a preview that matches the expected front-end result to improve the ability for users to select the right layout design for their needs and to better match.
The text was updated successfully, but these errors were encountered: