gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

wide and full alignment for paragraph block may be needed again.

Open nickfmc opened this issue 5 years ago • 15 comments

With @aristath work on this ticket https://github.com/WordPress/gutenberg/issues/25160 I think we need to consider theme developers that use this type of CSS for block alignment. A big issue we have now is nesting paragraphs/headings. You may have a situation where you have a block that is full width and has a bg color on it and inside that you might want to put a paragraph that is aligned wide. Well with this setup your paragraph will go to the smallest declared wrapper size, I'm constantly adding align-wide and align-full classes to my paragraph blocks manually right now to get past this. It doesn't need to be on by default, just a way to declare that you want wide and full alignment available on all blocks.

GB is assuming that all theme developers are using the same CSS for block alignment but do not give a default standard that everyone should be using.

nickfmc avatar May 03 '21 15:05 nickfmc

I agree. I think it's odd how a user may add a wide/fullwidth alignment to the Heading block, but not the Paragraph block. While the new Inherit default layout setting does make every block within the parent block inherit its layout width, if you set a custom value for content/wide — then again its off.

Screenshots

Everything is fullwidth if "Inherit default layout" is enabled (within a Group block). Screen Shot 2021-07-06 at 10 34 14 AM

What you end up with, if the new "Inherit default layout" setting is false. Screen Shot 2021-07-06 at 10 33 37 AM

Expected

I'd expect to be able to position P and H blocks similarly. I can't think of a reason why they'd be treated differently.

richtabor avatar Jul 06 '21 14:07 richtabor

I'm curious what the confusion with having P blocks with wide/full alignment (as referenced here: https://github.com/WordPress/gutenberg/issues/9597 ). And what's the justification for having Heading and Paragraph blocks treated differently?

richtabor avatar Jul 06 '21 14:07 richtabor

can we just expand this to add or have the option to add the wide/full alignments on all blocks? by choosing to only have this on some blocks, WP is basically deciding how you should setup your themes front end block layouts, only without providing any suggestions. if you were to add an align-wide block group and inside it you had a blockquote, it is forced to your narrow wrapper, with no way to make it wide, without just simply adding the alignwide class to it! my block layout works perfect except for this super frustrating fact I have to manually add classes. I used the register block styles to add the align wide class to my blocks that are missing it. then I have to add the .is-style-alignwide class to my styles also, but at least clients can layout the blocks how they need.

  'core/paragraph',
  {
    name: 'alignwide',
    label: 'Align Wide'
  }
);```

nickfmc avatar Aug 11 '21 17:08 nickfmc

What @nickfmc posted with having a style option for alignwide works for some cases, but unfortunately it doesn't work if you already have another style option you are trying to use on that element, since only one style option can be selected at a time. :(

SilasOtoko avatar Nov 18 '22 20:11 SilasOtoko

What @nickfmc posted with having a style option for alignwide works for some cases, but unfortunately it doesn't work if you already have another style option you are trying to use on that element, since only one style option can be selected at a time. :(

don't get me started on one style option! lol I've done that before too, had to do "align wide style one" "align wide style two" .

nickfmc avatar Nov 18 '22 21:11 nickfmc

This is definitely a needed feature. Doesn't make sense why the paragraph block doesn't have alignment settings.

james-s-k avatar Mar 23 '23 22:03 james-s-k

I don't quite understand why you can't make the paragraph block align wide.

I'm a user. I want to add a Heading and a subtitle/paragraph. I want to do this in the template parts area. I add a Heading Block and a Paragraph Block. I group them. I set Heading to alignwide, I can't set Paragraph to alignwide. Really? You can if you add a column block and add a paragraph tag inside a column, and you set the Column block to alignwide, but this seems a bit crazy.

patrickwc avatar Apr 26 '23 15:04 patrickwc

In case it helps someone, you can get around this by having a group block within a group block. Group your group, then set the child group block to be align wide. Paragraph tags inside that block will now all be wide width.

patrickwc avatar May 03 '23 18:05 patrickwc

In case it helps someone, you can get around this by having a group block within a group block. Group your group, then set the child group block to be align wide. Paragraph tags inside that block will now all be wide width.

Yeah that's a valid method and what I normally end up doing. Just annoying to have to do that.

SilasOtoko avatar May 03 '23 21:05 SilasOtoko

Paragraph block really should also include alignment controls just like the Heading block. As it creates consistency between two text focused blocks.

paaljoachim avatar Jun 06 '23 10:06 paaljoachim

I had a client ask me. How can I add wide to the Paragraph block just like the Heading block? I had to say that it is not yet possible.... then say I do not know why one can add wide to Heading and not the Paragraph block.

paaljoachim avatar Jan 24 '24 21:01 paaljoachim

Is this feature planned/on the roadmap? If not, any good reason why? I keep coming across the need for this and am surprised this issue is 3 years old (maybe there's a more recent solution I'm unaware of?).

kaelansmith avatar Jun 13 '24 04:06 kaelansmith

Is there any progress?

silvanarnet avatar Nov 05 '24 13:11 silvanarnet

@SilasOtoko Thank you for helping on this! Would you be able to link your WordPress and Github accounts to ensure your work is properly credited in WordPress releases?

aaronjorbin avatar May 19 '26 21:05 aaronjorbin

@nickfmc Thank you for helping on this! Would you be able to link your WordPress and Github accounts to ensure your work is properly credited in WordPress releases?

aaronjorbin avatar May 19 '26 21:05 aaronjorbin