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

[Twenty Twenty-One] Grid Block stacks to a single column in editor #7943

Closed
mrfoxtalbot opened this issue Jul 9, 2024 · 9 comments
Closed
Assignees
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. [Pri] High [Status] Priority Review Triggered KitKat has been notified of this issue in #dotcom-triage-alerts [Theme] Twenty Twenty-One Triaged [Type] Bug Something isn't working

Comments

@mrfoxtalbot
Copy link

mrfoxtalbot commented Jul 9, 2024

Quick summary

The grid block does not show multiple columns when used with Twenty Twenty-One on a dotcom site:

Screenshot 2024-07-09 at 15 20 05

Below is what the Grid Block looks like in the editor using TT1 on a self-hosted site:

Screenshot 2024-07-09 at 12 27 14

The layout is also broken in the front end (in the published post) but this second issue appears to be coming directly from core and was reported here: WordPress/gutenberg#63300

Screenshot 2024-07-09 at 12 30 47

Steps to reproduce

  1. Activate Twenty Twenty-One
  2. Create a new post and insert a Grid block
  3. Notice how it stacks to as single column

What you expected to happen

It should show a grid

What actually happened

It stacked into a single column.

Impact

All

Available workarounds?

No but the platform is still usable

Platform (Simple and/or Atomic)

Simple, Atomic

Logs or notes

No response

@mrfoxtalbot mrfoxtalbot added [Type] Bug Something isn't working [Feature Group] Appearance & Themes Features related to the appearance of sites. Needs triage labels Jul 9, 2024
@mrfoxtalbot mrfoxtalbot transferred this issue from Automattic/wp-calypso Jul 9, 2024
@mrfoxtalbot mrfoxtalbot changed the title Grid Block stacks to a single column in editor [Twenty Twenty-One] Grid Block stacks to a single column in editor Jul 9, 2024
@mrfoxtalbot
Copy link
Author

@dsas, sorry to keep pinging you but could you take a look to help triage this? Please note that the Grid block is also partially broken in core WordPress/gutenberg#63300 Thank you!

@github-actions github-actions bot added the [Status] Priority Review Triggered KitKat has been notified of this issue in #dotcom-triage-alerts label Jul 9, 2024
@up1512001
Copy link

This is an issue with the TT1 theme I checked it's due to this code present in the style.css file at the 2154 line number.

.wp-block-group:before,
.wp-block-group:after {
	content: "";
	display: block;
	clear: both;
}

before removing this code

Screenshot 2024-07-09 at 23 35 24

after removing this code

Screenshot 2024-07-09 at 23 35 50

@dsas
Copy link
Contributor

dsas commented Jul 10, 2024

@up1512001 fix looks like it will probably fix the problem but I don't think it's the correct fix. @mrfoxtalbot is right that this problem doesn't exist in dotorg. It looks to me like the root cause is that the markup output differs between dotorg and dotcom.

dotcom markup

(excess newlines removed)

<div class="wp-block-group is-layout-grid wp-container-core-group-is-layout-1 wp-block-group-is-layout-grid">
<p>First cell</p>
<p>Second cell</p>
<p>Third cell</p>
</div>

dotorg markup

(excess newlines removed)

<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-grid wp-container-core-group-is-layout-1 wp-block-group-is-layout-grid">
<p>First cell</p>
<p>Second cell</p>
<p>Third cell</p>
</div></div>

The way this works in TT1 on a dotorg site is that the outer div - div.wp-block-group has the display:block rule but the inner div - div.wp-block-group__inner-container has a display:grid.

For some reason the dotcom output doesn't include the inner div. It looks like it's been added to GB for a long time so I'm not sure why it is not being output yet.

@jartes jartes moved this from Needs Triage to Triaged in Automattic Prioritization: The One Board ™ Jul 10, 2024
@dsas
Copy link
Contributor

dsas commented Jul 10, 2024

Sorry @up1512001 after having done some research it appears that this was intentional, and so we do just need to fix the styles. More detail over on the GB issue.

@lsl lsl moved this from Triaged to In Progress in Automattic Prioritization: The One Board ™ Jul 26, 2024
@lsl
Copy link

lsl commented Jul 26, 2024

@dsas This was also being tracked on the one board, if you'd like help with reviews or anything let us know.

@mrfoxtalbot
Copy link
Author

I see a commit in trunk that should fix this. Check this comment. WordPress/gutenberg#63300 (comment)

@lsl
Copy link

lsl commented Jul 28, 2024

I think that might just make core behave the same way, we'll need to fix the css in 2021 theme.

Thanks for the ping! This made me realise that WordPress/gutenberg#49387 was never synced to core when the grid layout was stabilised, which it should have! So the broken behaviour you're seeing with Gutenberg enabled would also be happening in core if that PR had been synced.
...
Quick follow-up on this: the sync of WordPress/gutenberg#49387 has now been committed to core trunk.

@dsas
Copy link
Contributor

dsas commented Aug 5, 2024

There is now a commit in trunk to fix this.

Looks like our copy of TT1 is rather out of date. I'll look at merging it, following this process tomorrow: PNEWy-cvG-p2

@dsas dsas self-assigned this Aug 5, 2024
@dsas
Copy link
Contributor

dsas commented Aug 6, 2024

Merged from core and shipped on wpcom in r66773. Big thanks to @up1512001 for the upstream work.

@dsas dsas closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature Group] Appearance & Themes Features related to the appearance of sites. [Pri] High [Status] Priority Review Triggered KitKat has been notified of this issue in #dotcom-triage-alerts [Theme] Twenty Twenty-One Triaged [Type] Bug Something isn't working
Development

No branches or pull requests

5 participants