gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Add justified text alignment option to text alignment toolbar

Open ZebulanStanphill opened this issue 8 years ago • 28 comments

There is a text alignment option missing

The standard text alignment toolbar component in Gutenberg currently supports left, center, and right alignment. However, it currently does not have an option for justified text alignment (text-align: justify). I think this option should be added to the standard text alignment toolbar component.

ZebulanStanphill avatar May 18 '18 16:05 ZebulanStanphill

Justify and underline were dropped from the default editor since 4.7. I don't remember the exact reasons but I don't think it's coming back.

vtrpldn avatar May 18 '18 18:05 vtrpldn

I've filed this away in the Ideas project for future consideration.

danielbachhuber avatar May 18 '18 21:05 danielbachhuber

The underline and justify buttons are no longer available. According to Andrew Ozz, who primarily works on the TinyMCE editor in WordPress, underlining text causes confusion as readers may interpret it as a link. The justify button was removed because it has uneven browser implementation and often makes text less readable. However, keyboard shortcuts for both buttons will continue to work in 4.7.

https://wptavern.com/wordpress-4-7-removes-the-underline-and-justify-buttons-from-the-editor

ajitbohra avatar May 19 '18 08:05 ajitbohra

Justify and underline were dropped from the default editor since 4.7. I don't remember the exact reasons but I don't think it's coming back.

But you could use the shortcut Shift + Alt + J to justify the selected text. With Gutenberg this shortcut does not work anymore!

mlopezcoria avatar Nov 08 '18 05:11 mlopezcoria

Justify and underline were dropped from the default editor since 4.7. I don't remember the exact reasons but I don't think it's coming back.

But you could use the shortcut Shift + Alt + J to justify the selected text. With Gutenberg this shortcut does not work anymore!

return at least Shift + Alt + J

Mc61 avatar Nov 29 '18 17:11 Mc61

Shift+Alt+J doesn't work in Gutenberg editor. Please tell any other option to justify text alignment.

Shivangi1985 avatar Dec 07 '18 13:12 Shivangi1985

Shift+Alt+J doesn't work in Gutenberg editor. Please tell any other option to justify text alignment.

You can achieve this with CSS.

If you add the following CSS at Appearance → Customize → Additional CSS:

/* --- Justify Text Option --- */
.justify-text {
	text-align: justify;
}

Then in the editor when you have a block selected you can add the CSS class justify-text in the right bar under "Advanced", example: https://snag.gy/SKIoHe.jpg

mikeicode avatar Dec 09 '18 14:12 mikeicode

Hi there, this is truly a weird choice, justified text is something that clients ask for a lot, and having to use a class for this seems quite overkill. Any update on this, or maybe a way to extend components to add it in?

BrunoBoehm avatar Jan 18 '19 17:01 BrunoBoehm

i too agree with BrunoBoehm. frustrating that justify text has been removed.

helen-oneill avatar Feb 18 '19 01:02 helen-oneill

Shift+Alt+J doesn't work in Gutenberg editor. Please tell any other option to justify text alignment.

You can achieve this with CSS.

If you add the following CSS at Appearance → Customize → Additional CSS:

/* --- Justify Text Option --- */
.justify-text {
	text-align: justify;
}

Then in the editor when you have a block selected you can add the CSS class justify-text in the right bar under "Advanced", example: https://snag.gy/SKIoHe.jpg

Worked perfectly, THANK YOU so much!

helen-oneill avatar Mar 12 '19 22:03 helen-oneill

Any updates on this one? Justify was really nice feature.

okainov avatar Jul 27 '19 18:07 okainov

@ajitbohra if there are so many people asking for this option why can't it be added back? If you don't need it, then you don't have to use it. At least give us an option. Custom CSS is a workaround, but there should be an option (button) that does this, without any workarounds.

Misiu avatar Aug 21 '19 12:08 Misiu

Why is this closed?!

ilDon avatar Jan 07 '20 19:01 ilDon

Why is this closed?!

The Paragraph block now has a justify option:

img Full image: https://d.pr/i/eIecWQ

mikeicode avatar Jan 07 '20 21:01 mikeicode

@mikeicode thanks for the update, do you know since what version? I fear that I'm stuck with an older one...

ilDon avatar Jan 07 '20 21:01 ilDon

thanks for the update, do you know since what version? I fear that I'm stuck with an older one...

I might have been slightly incorrect about that. After further testing I see that the latest Gutenberg and latest WP doesn't have this option. If you have Jetpack enabled on the site this option is available.

mikeicode avatar Jan 07 '20 21:01 mikeicode

This is the main reason why we do not use Gutenberg and the only reason I don't use it. Why would the only professional looking text alignment be insignificant and a dropped feature? Where are the business developers who actually listen to the end-users?

toudal avatar Apr 03 '20 11:04 toudal

@toudal: The Gutenberg Page Building Toolkit – EditorsKit plugin extends the Gutenberg editor by a text-align justify format option. It also offers other features (which can be all turned on/off).

While I agree that some important features for Gutenberg are still missing (notably multiple block style selection), the extensible nature of WordPress and Gutenberg can often offset this (like in this case by using a plugin).

strarsis avatar Apr 03 '20 13:04 strarsis

Well, this is funny. I'm the person who created this ticket asking for this feature, but now my opinion has flipped, and I think justified text is a bad idea. :laughing:

@toudal It's worth noting that the justify option was removed from the classic editor due to accessibility concerns, since justified text is considered harder to read than standard left/right-aligned text, since:

  • Every line being the same width makes it more difficult to find your place in a long paragraph compared to standard left/right-aligned text.
  • You have to hyphenate text to make sure there isn't a silly amount of space between words in a line, and this is really difficult in the context of responsive websites without using CSS properties that have limited browser support.

So user feedback is actually why the option was removed in the first place.

It's also worth noting that justified text is something you probably would never use on one or two blocks alone. If you're using it, it's probably a general design choice that applies across your site. Because of that, it should probably be up to the theme (or else the upcoming Global Styles system) to set the default text alignment to justified.

Because of these factors, I don't think it makes sense to provide a (visible) option to set individual paragraph blocks to justified text alignment in core WordPress. Of course, a plugin can add the option if you really want it, but since it is considered bad practice, it shouldn't be promoted as a visible option by a default WP installation.

ZebulanStanphill avatar Apr 03 '20 14:04 ZebulanStanphill

@ZebulanStanphill your point makes 100% sense and I am too now convinced that it should not be there. As you correctly pointed out, I did indeed add the justified style via CSS, as it was a general setting that I wanted for each paragraph of each article.

However, I still think that something should be done about it. A proper explanation, perhaps in the tutorial, or simply an "official" blog post on WordPress, would probably be enough. Otherwise it might look as if the lack of a justified option is due to a bad design of Gutenberg, which is on the contrary pretty well designed.

This is especially true for non tech-savvy users, which are the most likely to have troubles getting used to the idea of plugins, not to mention editing CSS.

ilDon avatar Apr 03 '20 14:04 ilDon