-
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
Erratic padding in pattern previews #52421
Comments
It could be related to #52155. |
@jameskoster, can you re-test this now that #52640 is merged? |
Still an issue I'm afraid. Patterns previews always seem to entertain the global padding setting. I suppose this could be related to #51937. |
Let's double-check and close one if they have the same cause. P.S. The #51937 was punted to WP 6.4. |
Imo the goal here should be for the previews to match the result upon insertion as closely as possible. When details in the preview do not match the result it can be a bit confusing. So I'd say the first and last previews in the screenshot above are working as intended (assuming neither have any padding values on their root containers). Presenting them this way helps the user understand that the pattern will fill the container upon insertion. |
Moving to 6.4 as there is no straightforward solution to this and any changes to padding behaviour may have unexpected side-effects, so we need a little more time to work something out! |
@glendaviesnz just to connect a dot, is this technically the same issue as #51937? Happy to close this out and consolidate if so. |
This is not quite the same issue, given that the fix for #51937 hasn't fixed this one. Can you point to any other themes aside from TT2 where this happens? Asking because that padding in the specific case of TT2 is actually coming from the theme stylesheet. Because the previews are iframed, there is no reliable way of targeting that element for an override. I'm not sure it would be desirable to override theme styles anyway 😅 |
Thanks for digging that up. I suppose this issue will occur whenever the active theme adds a custom padding value to
In this case I think it would be because the preview is (supposed to be) the pattern in isolation. Since the padding is not part of the pattern it breaks that convention leaving the user unsure whether it's a margin value attached to the pattern, or something else. Still, if there's no reliable way to override then I guess there's not much we can do. |
I'm not entirely sure but it may be possible to inject styles into the iframe from our side 🤔 Would it be safe to assume that in the pattern preview we'd always want the |
Imo yes. Otherwise its unclear whether that empty space in the preview is part of the pattern or something else. Ideally what you see upon insertion matches the preview as closely as possible. |
This seems to be more of an issue with some themes than others, so a bit tricky to track down. For testing purposes Twenty Twenty-Two is a good theme to have active.
Pattern previews (in the Inserter, and the Patterns section of the Site Editor) often include padding that is not visible when the pattern is inserted.
Notice the previews here all have empty space on the left and right:
But when you insert one, there is no such padding:
It is also not present if you edit the pattern in focus mode:
The text was updated successfully, but these errors were encountered: