WordPress / gutenberg

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

Add more choices to align supports #44653

Open phil-sola opened 1 year ago

phil-sola commented 1 year ago

What problem does this address?

Currently, you can support align, or alignWide for your blocks which gives you one additional wrapper width for your block aside from the content width defined.

On almost every single site I have developed, there is more use of content widths than just default and wide. Normally, there will be a narrow block or component, occasionally an x-wide width and of course, full width which is supported already.

The current support options are too restrictive and only allow for one of 2 different widths (excluding full). When developing custom blocks, I cannot use the supports and end up going with a custom setting to give a better choice.

What is your proposed solution?

I would love to see the option to define support for other wrapper widths as well.

Given that it is an array of possible choices it would be great to add a couple more possibilities to this including narrow and extra wide. These should also be configurable via theme.json just like the content width and wide width currently.

If you didn't need or want a narrow or extra wide width, it could simply be excluded from the array of supported align settings.

(https://developer.wordpress.org/block-editor/reference-guides/block-api/block-supports/#align)

jtoelli commented 1 year ago

I came here after looking for a way to add "narrow" as a align option similar to "wide" and "full" for core blocks like group/columns.

I totally agree there needs be at least a "narrow" option that can be enabled similar to "wide/full" or even better being able to define custom ones as you need them.

If anyone knows a way how this can be accomplished please share.

I will be watching this thread and hoping it will be implemented soon.

leias commented 1 year ago

+1 Currently solving with a lot of styles or setting widths manually, but a real bother when you need to apply multiple styles.

aadilayub commented 1 month ago

IMO this is a big pain point when adapting designs to the block editor. Most designs just aren't created with only two layout widths in mind.