0

How can we change the default color of RTE text color option "A". Please consider attached screen shot for more details.

Screen Shot

2 Answers2

3

Ideally, you want authors to use the style sheet to set the color of items rather than using markup in the RTE (like the forecolor plugin)

To import your stylesheet into the RTE follow this guide: http://docs.craftercms.org/en/3.0/site-administrators/studio/rte-setup.html

in the setup your RTE is using (general by default)

<rteStylesheets> <!-- This informs the RTE to use the CSS files -->
  <link>
    <loadFromPreview>true</loadFromPreview>
    <url>/static-assets/css/main.css</url>
  </link>
</rteStylesheets>  

Once you point the config to the style sheet in static assets you H1s etc should be styled appropriately. Note sometimes style sheets are overly specific and you need to take additional steps.

So for example the style sheet has:

body {
  color:red;
}

The RTE's text will be red. If someone updates the CSS, the RTE will update too.

Russ Danner
  • 693
  • 3
  • 11
  • Additional thought here: If you want one RTE to look different than another, use a different setup. You want one RTE setup per unique configuration. Multiple RTEs can use a setup. – Russ Danner Nov 14 '17 at 19:35
1

To add the text color option "A" in the toolbar of the RTE, all you have to do is add forecolor to the tag toolbarItems1 in the RTE Configuration file, that you can access from Site Config -> Configuration, then select RTE Configuration from the dropdown.

<toolbarItems1>
formatselect,|,bold,italic,underline,strikethrough,|,sub,sup,charmap,|,forecolor,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,managedImage,link,unlink,anchor,|,edithtml,|,undo,redo
</toolbarItems1>
alhambrav
  • 11
  • 1
  • Text color option "A" in the toolbar of the RTE is already there but we need to change this default color (Dark Gray) with another color. – Santosh Prajapat Nov 14 '17 at 18:47