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

Gutenberg trunk: Unexpected changes to spacing compared to 16.3.0 #53450

Closed
carolinan opened this issue Aug 9, 2023 · 6 comments
Closed

Gutenberg trunk: Unexpected changes to spacing compared to 16.3.0 #53450

carolinan opened this issue Aug 9, 2023 · 6 comments
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

carolinan commented Aug 9, 2023

Description

I am seeing changes to spacing in Gutenberg trunk compared to 16.3.0. How can I tell if it is a bug or intended? Blocks that did not run up to the edge of the browser window in 16.3.0 now do so on trunk.

I have been unable to locate the change by comparing the CSS that this applied to my nested groups.

Step-by-step reproduction instructions

Create a new header template part with this code:

<!-- wp:group {"layout":{"type":"constrained"}} -->
<div class="wp-block-group">
	<!-- wp:group {"align":"full","layout":{"type":"flex","justifyContent":"space-between","flexWrap":"wrap"}} -->
	<div class="wp-block-group alignfull">
		<!-- wp:group {"layout":{"type":"flex"}} -->
		<div class="wp-block-group">
			<!-- wp:site-logo {"width":40} /-->
			<!-- wp:site-title /-->
		</div>
		<!-- /wp:group -->
		<!-- wp:navigation {"overlayMenu":"always","overlayBackgroundColor":"base","overlayTextColor":"contrast"} /-->
	</div>
	<!-- /wp:group -->
</div>
<!-- /wp:group -->

In theme.json settings, I have "useRootPaddingAwareAlignments": true and under styles I have:

"spacing":{
			"blockGap": "1.7rem",
			"padding": {
				"top": "2rem",
				"right": "2rem",
				"bottom": "2rem",
				"left": "2rem"
			}
		}

Screenshots, screen recording, code snippet

This is my header template part edited in isolation, with Gutenberg 16.3.0, and identical in WP 6.3 without Gutenberg active.
There is horizontal spacing to the left and right of the site logo and navigation block button that corresponds to the global spacing in theme.json:
header template part with nested groups and navigation block

This is the same template part with Gutenberg trunk active. There is no horizontal spacing to the left and right of the site logo and navigation block button:
header template part that is missing left horizontal spacing

The issues is also visible on the front. I choose the editor view because it makes it easier to see how the blocks are nested.

Environment info

WP 6.3 with and without Gutenberg 16.3.0 and Gutenberg trunk

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

@jordesign jordesign added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks labels Aug 10, 2023
@mikachan
Copy link
Member

Is this maybe related to or the same issue as #52163?

@carolinan
Copy link
Contributor Author

That issue is from June, this problem is weeks old.

@carolinan
Copy link
Contributor Author

This is still a problem if I activate Gutenberg trunk or Gutenberg 16.6.0 on either 6.3.1 or 6.4 alpha.

@tellthemachines do you know anything about if this change is intended?
My concern is that it is an unexpected visible change on the user's website that they did not apply or make themselves.

Front on 6.4 alpha without Gutenberg

block spacing without Gutenberg

Front with Gutenberg active:
spacing with Gutenberg enabled

@tellthemachines
Copy link
Contributor

@carolinan from your test markup it looks like it might be a result of #53259. It's hard to define what's right or wrong behaviour for the smart root padding alignments, but enough folks seemed to think that adding root padding to flex blocks was unexpected that it was considered a bug.

So to answer your question, it is an intended change. Unintended breakage to existing websites is an unfortunate side effect of any changes to root padding, but I don't think there's any way around that 😞

@carolinan
Copy link
Contributor Author

Thank you. I think you are right that there is no way around it, and with the response, I can start re-building my themes (again).
I see the backport ticket and that the change is going into 6.4, it would be great if the commit could be done as early as possible. We need time to test the default block themes and TT4, too.

@carolinan carolinan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
@tellthemachines
Copy link
Contributor

it would be great if the commit could be done as early as possible

I'm just waiting on a review; I like to do so for core commits even though it's not strictly necessary 😅 but we should manage to get it in before the end of this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants