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

Global padding not applied in the template part editor #59742

Open
lunule opened this issue Mar 11, 2024 · 4 comments
Open

Global padding not applied in the template part editor #59742

lunule opened this issue Mar 11, 2024 · 4 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme.

Comments

@lunule
Copy link

lunule commented Mar 11, 2024

Description

The global padding feature, when useRootPaddingAwareAlignments is set to true in the theme.json file, is not working properly in the site editor:

  • while global paddings are applied in the template editor,
  • the same global paddings are not applied in the template part editor - the has-global-padding class is applied correctly, but the class styles are missing.

Template editor => header with horizontal paddings displayed correctly

global-padding--template-editor

Template part editor => header with horizontal paddings displayed incorrectly

global-padding--template-part-editor

Step-by-step reproduction instructions

  1. Use a layout.type = constrained div (directly following a layout.type = flow div, or one without layout.type specification) in a template part
  2. Set up non-zero styles.spacing.padding values in the theme.json file
  3. Test the padding display
    • in the template editor at first
    • then in the template part editor

Screenshots, screen recording, code snippet

No response

Environment info

No response

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

@lunule lunule added the [Type] Bug An existing feature does not function as intended label Mar 11, 2024
@carolinan
Copy link
Contributor

I agree, that the padding is missing is confusing to me too when I am working with the template parts in "isolation".
To me, it makes it more difficult to create designs. Because I keep thinking that I need to add the spacing to the actual content inside the part. If the user does that, the padding is of course duplicated when you view the full page or template.
Also, the global styles panel is available and it is possible to adjust the site wide spacing from this screen, in the Styles > Layout panel, event hough it is not applied and you can't see it.

I was told that this is intentional. I'm not sure if I can find the conversation, if I do stumble upon it again I will add a link here.

@lunule
Copy link
Author

lunule commented Mar 11, 2024

To me, it makes it more difficult to create designs. Because I keep thinking that I need to add the spacing to the actual content inside the part.

I agree - this is the exact reason why I think this current implementation is not developer-, designer-, or user-friendly. It's a deceptive experince while working on theme design.

I was told that this is intentional. I'm not sure if I can find the conversation, if I do stumble upon it again I will add a link here.

Thanks - I would think the reasoning is about that the template part editor should display content and styles used strictly in the part design, while global padding is, well, global, so it should be displayed in the larger context only, which is the template, not some of its parts (even if the global padding is practically applied only on a container element of a template part).

Personally, I would partially agree with such reasoning, but overall, I would also vote against it because this is a theory vs. practice/experience type of topic, and, as the purpose of the whole Full Site Editing paradigm is providing site owners with an easy-to-use and easy-to-learn site editor and site editing experience - and this easy-to-misinterpret experience definitely goes against the principle.

@jordesign jordesign added the [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. label Mar 12, 2024
@annezazu annezazu removed the [Type] Bug An existing feature does not function as intended label Mar 12, 2024
@annezazu
Copy link
Contributor

annezazu commented Mar 12, 2024

Hey folks! Here's the discussion if I have it correct: #51937 I've removed the bug label for now.

@iamtakashi
Copy link

I agree. The discrepancy in appearance between the site editor and the template part editor doesn't make sense to me, even though it's technically correct. I assume it doesn't make sense to the vast majority of users too. In my opinion, it should appear identically in both editors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme.
Projects
None yet
Development

No branches or pull requests

5 participants