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

Specification Change for Column Block Breakpoints #56138

Open
nendeb opened this issue Nov 15, 2023 · 0 comments
Open

Specification Change for Column Block Breakpoints #56138

nendeb opened this issue Nov 15, 2023 · 0 comments
Labels
[Block] Columns Affects the Columns Block Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.

Comments

@nendeb
Copy link

nendeb commented Nov 15, 2023

What problem does this address?

In the Column Block, the breakpoint for becoming a single column has been fixed at 781px using CSS media for some time now. Consequently, when placing a Column Block inside another Column Block, the visual appearance becomes challenging due to the narrow display width at the media breakpoint of 781px.

For instance, when using a Column Block to set up a sidebar (2 columns) in a block template, the content width becomes narrow. As a result, when using a Column Block in the content area, one is forced to design with a width that accounts for the sidebar's space, which is a minimum of 782px, restricting design layout possibilities.

Therefore, I propose a specification change for the Column Block breakpoints.

What is your proposed solution?

Here are a couple of potential approaches:

  1. Use container instead of media.
    Breakpoints will occur based on the actual width of the Column Block, regardless of its placement.

  2. Allow setting breakpoint values for each Column Block.
    Introduce a TextControl in InspectorControls to set breakpoint values for each Column Block.

There may be other viable approaches as well.

It's important to consider that this change will have implications for themes and block patterns.

Reference Current CSS code

Gutenberg 17.0.2
gutenberg/build/block-library/blocks/columns/style.css
gutenberg/build/block-library/style.css

WordPress 6.4.1
wp-includes/blocks/columns/style.css
wp-includes/css/dist/block-library/style.css

@media (min-width:782px){
  .wp-block-columns{
    flex-wrap:nowrap !important;
  }
}
@media (max-width:781px){
  .wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{
    flex-basis:100% !important;
  }
}
@media (min-width:782px){
  .wp-block-columns:not(.is-not-stacked-on-mobile)>.wp-block-column{
    flex-basis:0;
    flex-grow:1;
  }
}

Related Issues

There were related issues and PRs in the past, but they seem to have stopped.

Replace hardcoded breakpoints in front-end CSS with more modular CSS #35848

CSS Grid for columns block #21190

Can the breakpoint value be changed? #19460

Columns Block: Improve readability on smaller screens #30480

[WIP] Update Columns block to use CSS Grid, add option to adjust grid gap #32137

Example

Captured at 782px screen width
When displayed at 781px, the display breaks and all column blocks are displayed in a single column.

Upper:Column block (3 columns) in place
Bottom row:Column block (3 columns) inside column block (2 columns)

wp64_column_block_782px

@nendeb nendeb added the [Type] Enhancement A suggestion for improvement. label Nov 15, 2023
@t-hamano t-hamano added the [Block] Columns Affects the Columns Block label Nov 15, 2023
@jordesign jordesign added the Needs Design Feedback Needs general design feedback. label Nov 15, 2023
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 Needs Design Feedback Needs general design feedback. [Type] Enhancement A suggestion for improvement.
3 participants