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

Created on 28 Oct 2020  路  2Comments  路  Source: WordPress/gutenberg

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鈥檛 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.

[Block] Columns [Type] Bug

Most helpful comment

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

All 2 comments

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorscode picture moorscode  路  3Comments

davidsword picture davidsword  路  3Comments

nylen picture nylen  路  3Comments

youknowriad picture youknowriad  路  3Comments

pfefferle picture pfefferle  路  3Comments