-
Notifications
You must be signed in to change notification settings - Fork 182
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
Update empty theme to use Gutenberg alignments #233
Conversation
emptytheme/experimental-theme.json
Outdated
} | ||
"layout": { | ||
"contentSize": "800px", | ||
"wideSize": "1000px" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should match the widths used above, right? 840px and 1100px?
This is what I'm seeing when testing against the latest Gutenberg
Post/Page Editor: Site Editor: |
@kjellr I just pushed another update to this to take advantage of the change in WordPress/gutenberg#29335. Let me know how it looks now... |
That definitely helped, but this is still an issue:
I think we need those global layout rules to apply to blocks in the root of the page, and also inside of template parts, right? Also, I'm seeing some weirdness with standard-width text blocks inside of Group blocks. This only happens in the post/page editor: |
Depending on the design of the theme, this might not be true. It's only true for themes with regular layouts. A header template part followed by post content followed by a footer and even in this case, you might want your footer to be full width or your header... I think the current behavior is the right one (opt-in to global layout in templates where you need it). We can continue discussing here as it's related. |
I checked the paragraph issue, it seems related to the "reset" we apply on the editor styles, I need to think about it more but it's more a Gutenberg issue. I think this PR is good. |
@kjellr This PR should fix the paragraph thing, but I'd love some extensive tests WordPress/gutenberg#30038 |
The problem is the post editor has a container block which is "post-content" but that container is external to the editor, it's in the template, so we need a way to tell the editor what layout is actually defined on the template, does that container support wide/full widths, what are the sizes... In the site editor, you're rendering the "body" of the page by default, which means there's no layout by default, there's no container and each theme could have its own layout, its own design, so there's no way to say: there's one layout use it everywhere. Imagine a theme doing this for instance |
I think that layout would be possible either way. The benefit to setting default layout widths on the body (while allowing users/themers to opt-out of it) is just the consistency aspect: a paragraph would look the same in both places. I'll think more about it over the weekend, and loop in some other designers — I think this could benefit from some wider consideration. Also, either way I think this needs some adjustment: template parts that sit directly in the root of the document have alignment controls, but they don't really do much today: |
Yeah, this sounds like a bug to me, I'd personally just remove all alignments from root level blocks on the site editor (templates), potentially keep left/right but not sure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the PR looks good! I'll go ahead and merge this in.
I think if we add inherit layout support to template parts that would go a long way to fixing these issues. |
Now that WordPress/gutenberg#29335 has merged, we can update empty theme to use the new layout styles.
I'm not sure if I've done this right, the group block looks like this: