Richtextfield set font color property

824 views
Skip to first unread message

Diego Martinez

unread,
Sep 13, 2016, 7:28:06 AM9/13/16
to Wagtail support
Hi everibody!

Can we change the font style in a rich text field? eg font-color


Matthew Westcott

unread,
Sep 13, 2016, 11:07:18 AM9/13/16
to wag...@googlegroups.com
Hi Diego,

No, this isn't possible (at least, not without some hacky customisation). This is deliberate - font styles are a decision to be made by the template designer, not the content author, and so they should be defined within the template HTML / CSS, not inside the page content.

If you really think you need the ability to change colours within rich text content, ask yourself this: what _information_ am I trying to communicate with the change of colour? Then, find a way to model that information in your page model. For example: maybe your text includes "warning" paragraphs that need to be highlighted in red...? If so, you could use a StreamField (http://docs.wagtail.io/en/v1.6.2/topics/streamfield.html) with separate block types for "normal paragraph" and "warning paragraph". This has the advantage that if you decide to change the 'warning' style later on, you can just fix it in one place in your CSS, rather than going back through all of your content and changing the red text.

Cheers,
- Matt
Reply all
Reply to author
Forward
0 new messages