WordPress / twentytwentytwo

Twenty Twenty-Two, the default WordPress theme that will launch with WordPress 5.9.
406 stars 91 forks source link

Try body instead of wp-site-blocks #331

Closed richtabor closed 2 years ago

richtabor commented 2 years ago

Description

Closes #330 (potentially). As pointed out in #330, there's inappropriate padding left/right being added to patterns within the block previews. This PR switches the selector --wp--custom--spacing--outer is applied to, from .wp-site-blocks and body > .is-root-container to just body.

The end result is the left/right padding is properly applied within the editor, but not doubled-up within the BlockPreview component. I did have to use !important though, as the BlockPreview component has an inline style of padding: 0 on it.

Screenshots

Add screenshots of the change, if applicable

Testing Instructions

Provide steps for testing

  1. Look at patterns in the Pattern Library, see if align full patterns are indeed
  2. Add an align full pattern to the page, see that its still fullwidth
  3. Check the pattern on the front-end, see if its still fullwidth
  4. Check other elements to ensure switching padding to body does not negatively affect other areas of the theme
richtabor commented 2 years ago

Still testing this, I'm not sure if this will actually solve.