Skip to content

Columns Block: when the total column width is less than 100%, the columns appear centered inside the editor, left-aligned on the front #26538

Closed

Description

@dianeco

Describe the bug
Inside the editor, when a single column is added and its width is set to a custom value (e.g. 50%), the column is centered inside its parent (columns) container. While on the front, the column is left-aligned inside its parent container. (Note that it also happens with multiple columns when their total width isn’t 100%).

To reproduce
Paste the following code inside the editor:

<!-- wp:columns {"align":"wide","style":{"color":{"background":"#e5e3e3"}}} -->
<div class="wp-block-columns alignwide has-background" style="background-color:#e5e3e3"><!-- wp:column {"width":"50%"} -->
<div class="wp-block-column" style="flex-basis:50%"><!-- wp:paragraph -->
<p>Single column set to 50%.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Lorem ipsum dolor sit amet, commodo erat adipiscing elit. Sed do eiusmod ut tempor incididunt ut labore et dolore.</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->

Inside the editor On the front-end
single-columns-editor single-columns-front

Expected behavior
Inside the editor, the single column should be left-aligned.

Editor version:
WordPress 5.6 beta 2. Tested with the three latest default WordPress themes, including Twenty Twenty One.

Activity

  1. added
    [Block] Columns
    [Type] Bug
    on Oct 29, 2020
  2. tellthemachines commented on Nov 5, 2020

    @tellthemachines
    Contributor

    I can reproduce this in WP 5.5.3, so it's not a 5.6-specific regression. Editing the title to clarify.

  3. changed the title [-]Columns Block (WP 5.6 Beta 2): when the total column width is less than 100%, the columns appear centered inside the editor, left-aligned on the front[/-] [+]Columns Block: when the total column width is less than 100%, the columns appear centered inside the editor, left-aligned on the front[/+] on Nov 5, 2020
  4. self-assigned this
    on Nov 5, 2020
  5. JustinyAhin commented on Nov 5, 2020

    @JustinyAhin
    Member

    Seems like the normal/correct behavior is the one on frontend.
    If there's no alignment set, the columns should have default alignment.

  6. JustinyAhin commented on Nov 19, 2020

    @JustinyAhin
    Member

    I have been trying unsuccessfully for the last few days to build Gutenberg on my machine.

    So I am unassigning myself from this issue for now.

  7. removed their assignment
    on Nov 19, 2020
  8. self-assigned this
    on Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Block] Columns[Type] Bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions