WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.58k stars 4.23k forks source link

Vertical divider #51286

Open NekoJonez opened 1 year ago

NekoJonez commented 1 year ago

What problem does this address?

Sometimes, I like to work with columns to place text on a page. Yet, I sometimes want to place a line between the two columns. A vertical line. I could do that with a table and giving the outer borders the same color as the background... Yet, that's silly imho. So...

What is your proposed solution?

I think it would be cool if in the options of the divider you have an option to flip it vertical. And that this only works in columns or tables. And the divider is then as long as the columns. Or if this doesn't work as an option, maybe a new block?

bph commented 1 year ago

The core columns blog has border support, too. You could accomplish a separation by using a left and right side border on the middle column if you are dealing with a three column layout. Using this method, also gives you control over the padding and margin

Screenshot 2023-06-07 at 11 47 20

Does that look like a feasible way to move forward?

bph commented 1 year ago

Here is the front end: (would need some slight adjustments on the padding and margins)

Screenshot 2023-06-07 at 11 50 13
NekoJonez commented 1 year ago

I'm either overlooking something OR this is something that didn't get to core yet... Since when I click in WordPress 6.2.2 with the Neve theme... I don't see the options you show.

image

Or is this because I'm only using two columns?

NekoJonez commented 1 year ago

Hrm, it seems that these options don't appear on non FSE themes...

NekoJonez commented 1 year ago

@bph , sorry for the earlier ping... I had to delete the comment since it was untrue from later testing.

So, the features you have shown DO appear but only in site-editor/FSE themes. If you use a non FSE theme like Neve, Astra, SpicePress, Zakra... These options don't show up. Is that a bug in Gutenberg or a limitation of the themes?

NekoJonez commented 1 year ago

When Twenty Twenty-Three is active: image

When Neve theme is active: image

bph commented 1 year ago

Non-block themes need to enable the appearancetools via their functions.php

add_theme_support( 'appearance-tools' );

It's not.made available out of the box as there are a few edge cases with classic themes. Documentation: https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-support/#appearance-tools

You could test via a child theme if your site can work with those added tooling.

NekoJonez commented 1 year ago

I tried to add this in a child theme, but I'm not well versed enough in PHP to fix this. Curious, why are these features for block themes only? Since otherwise it might give the impression that we push people towards the block themes...