How to indent paragraph?
-
I haven’t found a way to indent a text paragraph in Gutenberg. Someone noted that there is a Classic block to which one can change to accomplish that, but there is no such block option.
If there is no way to indent paragraphs, that is a very serious omission.
-
Do you mean indenting, like, the first line? I haven’t seen a paragraph do that in a while.
Or do you mean pushing the whole paragraph over a bit?
As for first line indenting, well, adding spaces to the beginning of the paragraph works fine.
I mean indenting entire paragraphs, not just first lines.
Ah. Okay. Well, then you could make a class in your theme’s CSS to add some left margin to them. Like
.indented { margin-left: 30px }
or something like that.Then, for any block you want indented, you can use the “Advanced” section in the Block area, and just add “indented” to the Custom Class for that block. And then voila, it has a left margin.
- use a “Formatting > Classic” block
- if not visible yet, open second toolbar line (rightmost icon)
- enter and select your parargraph(s)
- click “Increase indent” button
The problem with using a classic block and manually indenting like that is that you run the risk of using different indents in different posts, and making the site look inconsistent. Better to use a fixed indent to keep the style consistent throughout the site.
Click “Increase indent” button in “Classic” block automatically uses a fixed indent of
style="padding-left: 30px;"
consistent in any post.That’s the way indenting whole paragraphs is done in WordPress since many years.
Adding own CSS and an own class is way too complex for regular users.
Click “Increase indent” button in “Classic” block automatically uses a fixed indent of style=”padding-left: 30px;” consistent in any post.
Yes, I’m aware. However it allows you to click it multiple times, and thus adjust the indent in increments of 30px. This is what I was referring to about inconsistency across various blog posts, because one might have 30, another might have 60 or 90, etc.
As for the usability, you are of course correct. However, this seems like an edge case to me in any case. However, a more scalable solution would be to introduce a Block Variant. You can find more info about these here: https://www.ads-software.com/gutenberg/handbook/designers-developers/developers/filters/block-filters/#block-style-variations
Such a variant would allow for a style to be simply selected in the block settings, and thus it could add the necessary class without typing it in manually. This would be a very small plugin, on the order of 20 lines of code.
Regular users won’t create block variants.
They look for features they had for years, like single/double/triple/.. indentation with a click.
And they will wonder why their existing indentations get lost when converting old content to blocks.
If the solution is as simple as you describe, I am wondering why this is not in core already, it’s a backwards compatibility issue after all, similar to this issue, @vesaraiskila and others would be happy.
Regular users won’t create block variants.
Regular users won’t need to create block variants. They’ll simply select a block variant from a block library, possibly one that is built right into the editor.
Don’t act like this is the end of development, and (plop) here’s the editor. The editor is an active, living, breathing project. Blocks can be developed entirely in Javascript, and used on sites without even installing plugins for them, eventually. Existing plugins will get new blocks, replacing old shortcodes. This is the foundation for future development, not the end of the line.
This is Phase 1 of the editor. Phase 2 will be much more interesting.
it’s a backwards compatibility issue after all
We’ve had the old hard to use editor for over a decade. Backwards compatibility in the editor is not guaranteed. But the old code you had works just fine. If you convert it to Blocks, then it might not be the same, and there is no guarantee that it will be.
The block editor has been developed since 1.5 years.
Now it has been released to regular users as mandatory replacement for classic editor.
Regular users expect that now available blocks at least match the existing features of classic editor.
As obviously features are missing and no block library exists yet, they will ask questions like this thread, again and again, and expect answers which do not include developing variants or waiting for future phases or how interesting things might be.
Their future is now. They want to get their work done with the editor now. @vesaraiskila wants to indent the paragraph now. The only simple workaround is via “Classic” block, as explained above. That’s it.
Regular users expect that now available blocks at least match the existing features of classic editor.
Well, that’s not happening. Little used features will be not be coming back.
You can use the Classic Editor plugin to go back to the old editor for now if you need those features.
I fully concur with @herbie888 here. We have used paragraph indentation a lot, so it is not a little used feature.
I find a lot of good in the block editor, but I cannot understand why the same functionality is not available in it as in the old, especially if implementing the feature in question here is not exactly rocket science, only a technical nuisance for end users.
Another feature I haven’t found in the new editor is the ability to prevent line separation for numbers, such as 20 000.
This is digressing from the topic, but we have also come across strange and extremely inconvenient functioning: copypasting a long piece of text into a post resulted in a classic block (with the old toolbar on top), and after editing, saving and reopening the draft most of the block was simply missing! Fortunately, I was able to salvage most of the disappeared text (and editing) from older automatic saves.
Hiya,
There’s a ticket to handle the classic block popping up when pasting content (which I find frustrating as well, it shows up both before and after and causes weird stuff if I don’t remember to remove them ?? )
You can follow along on the progress in https://github.com/WordPress/gutenberg/issues/9504
I’d like to throw in my vote for paragraph indentation in Gutenberg. I understand you want the editor to be clean and simple. But this is a feature many of us used – as several in this thread have said.
I have posted on the Github for Gutenberg and would encourage anyone else who wants this feature to do the same. Let’s let the developers know we would like this feature back.
- The topic ‘How to indent paragraph?’ is closed to new replies.