Skip to content

Columns Block Gutter Size Option #10730

@NenadObradovic

Description

@NenadObradovic

Hi guys,

Could you consider to add columns block gutter size option so we can be able to set space between columns item?

Possible solution:

  1. To add additional class on wp-block-columns element like you set for columns size, for example .normal-gutter
  2. SCSS solution
$columns-gutter-label: ('no', 'normal', 'large');
$columns-gutter-size: (0, 15, 25);

.wp-block-columns {
	
	@for $i from 0 to length($columns-gutter-label) {
		&.#{nth($columns-gutter-label,$i+1)}-gutter {
			$gutter-size: nth($columns-gutter-size, $i+1);
			
			@if ($gutter-size != 0) {
				margin: 0 -#{$gutter-size}px;
				
				> .wp-block-column {
					padding: 0 #{$gutter-size}px;
				}
			}
		}
	}
}
  1. CSS results
.wp-block-columns.normal-gutter {
  margin: 0 -15px;
}

.wp-block-columns.normal-gutter > .wp-block-column {
  padding: 0 15px;
}

.wp-block-columns.large-gutter {
  margin: 0 -25px;
}

.wp-block-columns.large-gutter > .wp-block-column {
  padding: 0 25px;
}
  1. Live results will be https://www.screencast.com/t/9CLHYaHGfg0U

Best regards,
Nenad

Metadata

Metadata

Labels

[Block] ColumnsAffects the Columns Block[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions