WordPress / theme-experiments

Experimenting with themes made out of blocks.
GNU General Public License v2.0
546 stars 180 forks source link

TT1-Blocks: Fix full width alignment for page-home post content #205

Closed jeyip closed 3 years ago

jeyip commented 3 years ago

Description

On initial creation, the page-home template appears to have content that doesn't respect wide width or full width alignment.

Screenshot 2021-02-01 at 23 31 04

Screenshots

Testing

kjellr commented 3 years ago

Is this an issue on TT1 Blocks' other page templates too? They don't seem to have this attribute on the post content.

vindl commented 3 years ago

Is this an issue on TT1 Blocks' other page templates too? They don't seem to have this attribute on the post content.

@kjellr there is more info about it in this comment https://github.com/Automattic/wp-calypso/issues/49573#issuecomment-777923802. It doesn't seem to be happening with other page templates.

kjellr commented 3 years ago

Very weird! This PR appears to work so I'm ok merging, but I'd like a quick gut check from @scruffian just to be sure.

jeyip commented 3 years ago

@kjellr @scruffian

Would we be comfortable adding an align: full attribute to other post-content blocks in tt1-blocks? Jacopo brought up some great points here:

Considering the Post Content role, I'm actually inclined to default it to full width, freeing its content up to align as they see fit. I might be overlooking something, but this is basically the same we already do with the Group block wrapping the page content inside a <main> tag:

<!-- wp:group {"tagName":"main", "align":"full"} -->
<main class="wp-block-group alignfull">
<div class="wp-block-group__inner-container">
<!-- wp:post-content /-->
</div>
</main>
<!-- /wp:group -->

Although, I'm also reluctant to assign a default alignment to a block, as I think this is more of a theme responsibility. We already align: full the Group block in all templates, I guess we should just do the same for Post Content