Wordpress Block Attribute Rich Text Control Align problem

Hi.

  1. I created a Wordpress Block with Smart Action and added Supports > Align.

Pinegrow-block-supports

  1. In a Paragraph inside the block I added a Block Attribute with control type “Rich Text”.

Pinegrow-block-attribute

  1. In Wordpress Editor although it appears the align controls the paragraph text do not align correctly always staying on the left.

  1. In the frontend it appears also always on the left.

Inspect
Pinegrow-Tree

So what am I doing wrong? Or it’s not supported this feature?
Thanks
Jorge

@Jorge the aligncenter class is visible on the top div in your screenshot. My guess is that you have to add custom CSS rules that will implement the actual align styling for your block, for different align* values.

@matjaz Thank you for your reply. Sorry but I didn’t get it, can you please elaborate? I want to manage the text alignment through the wordpress editor alignment controls, but it’s not working, although the controls are injecting the correct class “aligncenter” on the block.
So which custom CSS do I have to add if the class that I want is already there?

BTW, I am using Tailwind but apparently no class is interfering with the alignment settings.

If I add the Tailwind text-center class it centers correctly the text, but this is not what I want.

Thanks
Jorge

@Jorge add the rule such as:

.aligncenter {
    text-align: center;
}

/* Plus, similar rules for left and right */

into your site-wide stylesheet or into a stylesheet that gets included with a block.

More about block styling:

@matjaz It works like a charm.

I really didn’t know that this was need.

Thank you.