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

Can not add different content widths for different blocks in theme.json, display bug with alignment control #37124

Open
carolinan opened this issue Dec 4, 2021 · 2 comments
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@carolinan
Copy link
Contributor

Description

If someone tries to use different content widths for different blocks in theme.json, the control in the editor
shows the numbers, but the widths do not work.

If you add this code and place a group block inside a group block,
the alignment control for the parent block displays 840 and 1100, the control for the child displays 440 and 800.
The actual width of the child is 840.

{
	"version": 2,
	"settings": {
		"layout": {
			"contentSize": "840px",
			"wideSize": "1100px"
		},
		"blocks": {
			"core/group": {
				"layout": {
					"contentSize": "440px",
					"wideSize": "800px"
				}
			}
		}
	}
}

It is unclear if this is 1) Not supported yet 2) Supposed to work but is bugged.

It is not unlikely that developers expect settings.layout to work similarly to other settings where you can add different values for different blocks.

Step-by-step reproduction instructions

  1. Add the code above to theme.json
  2. In the editor, place a group block. Set it to wide width and enable "inherit layout"
  3. Place a second group block inside the first.
  4. Enable the different width alignment controls and compare what the "maximum width" says in the toolbar option, and the actual width.

Screenshots, screen recording, code snippet

different-content-width

Environment info

WordPress 5.9-beta1-52296-src
With and without Gutenberg 12.0.2.

Please confirm that you have searched existing issues in the repo.

No

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@annezazu annezazu added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Needs Technical Feedback Needs testing from a developer perspective. labels Dec 15, 2021
@annezazu
Copy link
Contributor

Curious if @jffng might have thoughts here.

@jordesign jordesign added [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. labels Aug 18, 2023
@tellthemachines tellthemachines added [Type] Enhancement A suggestion for improvement. [Feature] Layout Layout block support, its UI controls, and style output. and removed [Type] Bug An existing feature does not function as intended Needs Testing Needs further testing to be confirmed. Needs Technical Feedback Needs testing from a developer perspective. labels Apr 4, 2024
@tellthemachines
Copy link
Contributor

I can confirm this isn't supported yet. Layout settings aren't editable as global styles at the block level, only at the root level. The only layout-related setting that can be changed globally per-block is block spacing.

Let's consider this as an enhancement 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Layout Layout block support, its UI controls, and style output. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants