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

Query Loop: Add "Stack On Mobile" toggle for Grid View #34145

Open
Tracked by #41405
beafialho opened this issue Aug 18, 2021 · 6 comments
Open
Tracked by #41405

Query Loop: Add "Stack On Mobile" toggle for Grid View #34145

beafialho opened this issue Aug 18, 2021 · 6 comments
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.

Comments

@beafialho
Copy link

Not sure if this has been discussed somewhere else. If that's the case, please point me there.

In the Columns block, there's a toggle that allows you to choose whether columns stack on mobile or not:

S9GA-8hgcv

In the Query Loop block, when we select Grid View for posts, they always show up stacked on mobile because this option doesn't exist. That prevents us from achieving designs like the one below on mobile.

Captura de ecrã 2021-08-18, às 16 57 55

Mockup Gutenberg
More Posts_2 Frame 13

I propose we add it to allow more flexibility to create layouts.

@beafialho beafialho added [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Block] Query Loop Affects the Query Loop Block labels Aug 18, 2021
@kjellr kjellr added the [Type] Enhancement A suggestion for improvement. label Aug 18, 2021
@DHWP
Copy link

DHWP commented Jun 7, 2023

How is this still normal priority? this makes the query block unusable on a site that wants to display well on mobile...

@Paldom
Copy link

Paldom commented Aug 5, 2023

Is this still on the roadmap after 2 years?
This would be a very useful feature.

@Paldom
Copy link

Paldom commented Aug 5, 2023

Meanwhile a workaround (Styles / ADDITIONAL CSS)

@media(max-width: 781px) {
  .wp-block-post-template.is-flex-container.is-flex-container > li {
    width: auto !important;
  }
}

@osirismqz
Copy link

Meanwhile a workaround (Styles / ADDITIONAL CSS)

@media(max-width: 781px) {
  .wp-block-post-template.is-flex-container.is-flex-container > li {
    width: auto !important;
  }
}

Does not work anymore.

This worked for me:

@media(max-width: 600px) {
  .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

Maybe we need to wait another year for this basic feature to be included.

@palmsout
Copy link

palmsout commented Apr 6, 2024

@osirismqz thank you so much for this -- I was struggling to understand why the old workaround had stopped working. +1 to the notion that this should be definable in the query loop block itself. The standard column block should also allow you to set custom breakpoints.

@chuckpearson
Copy link

This works great, thanks for providing. I'm also surprised there is no toggle for this block in WP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Query Loop Affects the Query Loop Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

7 participants