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

Post Template: Applying background color adds inconsistent padding in the Editor #61655

Open
ndiego opened this issue May 14, 2024 · 1 comment · May be fixed by #61924
Open

Post Template: Applying background color adds inconsistent padding in the Editor #61655

ndiego opened this issue May 14, 2024 · 1 comment · May be fixed by #61924
Labels
[Block] Post Template Affects the Post Template Block Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@ndiego
Copy link
Member

ndiego commented May 14, 2024

Description

If you add background color to the Post Template block, it inherits padding from the styles from the List block in the Editor:

ol.has-background,ul.has-background {
    padding: 1.25em 2.375em
}

This padding is not applied on the front end, which is correct, in my opinion. We need to remove the padding in the Editor.

This issue seems related to #59455, cc @tellthemachines @ramonjd

Step-by-step reproduction instructions

  1. Open a new Playground instance and navigate to the Post Editor
  2. Using a Pattern, add one of the Posts options
  3. Inside the Post Template block, wrap all internal blocks in a Group and see the background color on the Group to any color.
  4. Then set the background color on the Post Template block to a different color. Notice how the padding is applied and that it does not show up on the frontend.

Screenshots, screen recording, code snippet

Editor Frontend
image image

Environment info

  • WordPress 6.5.3
  • Gutenberg 18.3

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

@ndiego ndiego added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Block] Post Template Affects the Post Template Block labels May 14, 2024
@ramonjd
Copy link
Member

ramonjd commented Jun 12, 2024

I think this may have been fixed by:

Which reduces the specificity of the rule:

:root :where(ul.has-background,ol.has-background) {
    padding: 1.25em 2.375em;
}

Given the above rule, the padding on the ul.wp-block-post-template in the editor is being reset here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Post Template Affects the Post Template Block Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants