Contentful logo

Contentful Community

How to apply colors to text in content

Hi,
I want to apply color to some of the text in the content. Any Idea would be greatly appreciated.

Thanks

The only way to archive this would be to create your own custom UI extension to replace the Markdown or Rich Text editors.

I very much urge you to re-evaluate if this is really necessary. Chances are that it’s not. Applying styling like color goes very much against Contentful’s ideology of storing semantic content, not styling.

Teemu raises a good point, @Nikhil.

The way to go here would be to associate a CSS property regarding color to your text.

Completely understood and that’s the plan now- Will have a separate text field defined for the one which needs color and separate for the ones that have no styling and group them together on the UI per requirement.

Thanks for the hep @teemu.tammela1 and @gabriel

No problem at all. Glad it helped :slight_smile:

Ya we have three projects running on contentful and the inability to edit the colors is ridiculous. I think we’re using the wrong product for what we’re trying to achieve.

1 Like

This feature is really a must-have, together with the possibility to align content, or indent content.

@teemu.tammela1 states that we should just implement our own custom UI for the rich text editor.

Of course that is a possibility. How come there is not a single example out there to show how this would be done? I am at a loss.
The only example I found was implementing tinyMCE into contentful, but that puts HTML into the textfield which is not an option for our company.

Our marketing team is against switching to contentful because of this omission.

I get that the underlying editor is Slatejs. And it seems that one doesn’t have any option to center or color text neither.

1 Like