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

Feature request: allow Columns block non-responsive option #31248

Closed
Sandstromer opened this issue Apr 27, 2021 · 4 comments · Fixed by #31816
Closed

Feature request: allow Columns block non-responsive option #31248

Sandstromer opened this issue Apr 27, 2021 · 4 comments · Fixed by #31816
Labels
[Block] Columns Affects the Columns Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@Sandstromer
Copy link

Sandstromer commented Apr 27, 2021

What problem does this address?

Currently the columns block will always go to a 50/50 layout at browser widths between 600px and 781px, and 100% at widths below 600px. This is regardless of the number of columns or customized column widths.

There will be instances where it is preferable to keep columns at their above 781px layout, even when viewed on narrower screens, so it would be great if the columns block could have an option to "turn off" the responsive layout.

What is your proposed solution?

Give the columns block something like a "not responsive" or "do not stack on mobile" toggle.

@carolinan carolinan added [Block] Columns Affects the Columns Block [Type] Enhancement A suggestion for improvement. labels May 1, 2021
@Sandstromer
Copy link
Author

In TT1-Blocks we have meta data in a columns block with date & author in the left column, and categories & tags right-aligned in the right column.

gutenberg-columns-50-50

On smaller screens the columns are forced to 100% width by flex-basis: 100% !important.
IMHO this looks horrible especially as there is no way to make the right column switch to left-aligned when it is stacked.
This becomes even more apparent when a theme makes use of the flex-columns layout attribute of the query block. The columns are only resized based on the browser width, and not the width of each post in the query block columns, which can be similar widths on large screens and smaller devices, as the query block columns do resize based on the browser width.

gutenberg-columns-mobile-100-forced

The problem is that themes cannot overide this using a block style without removing and replacing the core columns-block stylesheet.

An idea would be to change the columns-block styling from this:

.wp-block-column {
  flex-basis: 100% !important;
}

...to something like this:

.wp-block-columns:not(.is-not-stacked) .wp-block-column {
  flex-basis: 100% !important;
}

This would be compatible with a toggle option to turn off the forced stacking, and would not break older columns layouts.

@kjellr
Copy link
Contributor

kjellr commented May 5, 2021

I thought we had another issue filed for this, but I can't find one. In any case, I fully agree — the enforced one-and-two columns layouts on smaller screens really limit what's possible with block patterns. I'd love to see this one prioritized, as I imagine it's a relatively simple feature to implement.

@kjellr
Copy link
Contributor

kjellr commented May 6, 2021

Here's another example of this being problematic:

One desktop, it makes sense for these footer columns to be side by side:

Screen Shot 2021-05-06 at 10 26 01 AM

... and I'd prefer they stay that way on mobile when there's room. But instead, they stack automatically:

Screen Shot 2021-05-06 at 10 23 45 AM

Here's a GIF to illustrate the issue as well. You can see the three-column layouts wrap into two-column layouts at the middle breakpoint:

wrapping

@andrewserong
Copy link
Contributor

I thought I'd have a go at this one. I've opened up a PR in #31816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
4 participants