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

When editing a template part, the value of styles.spacing.padding in theme.json shouldn't be applied to the Site Editor wrapper #48098

Closed
Aljullu opened this issue Feb 15, 2023 · 2 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended

Comments

@Aljullu
Copy link
Contributor

Aljullu commented Feb 15, 2023

Description

The Site Editor is adding top and bottom padding to the .editor-styles-wrapper element in the site editor. That makes sense in the case of templates because that's how they are rendered in the frontend as well. But for template parts, that shouldn't be necessary because they are rendered inside a template and styles.spacing.padding is not applied to them.

Step-by-step reproduction instructions

  1. With TT3 or any other theme with useRootPaddingAwareAlignments set to true in theme.json, go to Appearance > Editor.
  2. Edit the Comments template part.
  3. Notice the .editor-styles-wrapper element has top and bottom padding (inherited from styles.spacing.padding).

Captura de pantalla de 2023-02-15 15-30-56

Expected behavior: no padding should be applied to .editor-styles-wrapper when editing template parts. In the frontend, templates parts don't inherit the padding from styles.spacing.padding, so in the editor they shouldn't either.

While for some template parts this issue is not critical (it just makes the template part to appear lower than it should), it's more problematic when the template part occupies the entire height available, for example a header with a height of 100vh or the Mini Cart template part in WC (see related issue: woocommerce/woocommerce#42482).

Screenshots, screen recording, code snippet

No response

Environment info

  • WP 6.1.
  • Gutenberg 15.1.0.

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

@Aljullu Aljullu added the [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") label Feb 15, 2023
@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Jul 27, 2023
@tellthemachines
Copy link
Contributor

Hi there @Aljullu! This should have been fixed in #54373 which was included in WP 6.4. Would you mind re-testing and checking whether it's still a problem?

@Aljullu
Copy link
Contributor Author

Aljullu commented Apr 8, 2024

You're right, @tellthemachines, this has been fixed. Thank you!

@Aljullu Aljullu closed this as completed Apr 8, 2024
@tellthemachines tellthemachines removed the Needs Testing Needs further testing to be confirmed. label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants