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

Why column blocks are not wrapped in a DIV? #7102

Closed
manake opened this issue Jun 2, 2018 · 2 comments
Closed

Why column blocks are not wrapped in a DIV? #7102

manake opened this issue Jun 2, 2018 · 2 comments

Comments

@manake
Copy link

manake commented Jun 2, 2018

Current:

<div class="wp-block-columns has-3-columns">
    <h2 class="layout-column-1">Heading</h2>
    <p class="layout-column-1">Paragraph.</p>
    <h2 class="layout-column-2">Heading</h2>
    <p class="layout-column-2">Paragraph.</p>
    <h2 class="layout-column-3">Heading</h2>
    <p class="layout-column-3">Paragraph.</p>
</div>

Proposed:

<div class="wp-block-columns has-3-columns">
    <div class="layout-column-1">
        <h2>Heading</h2>
        <p>Paragraph.</p>
    </div>
    <div class="layout-column-2">
        <h2>Heading</h2>
        <p>Paragraph.</p>
    </div>
    <div class="layout-column-3">
        <h2>Heading</h2>
        <p>Paragraph.</p>
    </div>
</div>

Otherwise I can't stack these columns on mobile resolutions and give each margin-bottom easily.

@manake
Copy link
Author

manake commented Jun 2, 2018

Here's another problem regarding this situation which I just discovered:

<div class="wp-block-columns has-2-columns">
    <div class="layout-column-1" style="width: 100%; height: 400px; background: #eee;"></div>
    <div class="layout-column-2">
        <p>Text 1</p>
    </div>
    <div class="layout-column-2">
        <p>Text 2</p>
    </div>
</div>

In the above case the #eee rectangle and Text 1 are horizontally on the same line. But Text 2 is positioned 400px from the top in the second column (when it's expected to be right below Text 1).

Proposed fix:

  • Wrapping columns in DIVs (like described in my first post) would solve this.
  • However, the current behavior is useful for some things so a better fix is this:
    • Add a setting to the current "Columns (Experimental)" block that would switch between various display options for columns (the current behavior should not be default).

@ocean90
Copy link
Member

ocean90 commented Jun 2, 2018

Thanks for your feedback. #5351 has a lot of discussion about the current implementation of the column block. I'm closing this to keep the discussion at one place.

@ocean90 ocean90 closed this as completed Jun 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants