I've used the plugins of redactor editor to change the font size and font color of text. It's working fine in other tags except the header. Don't understand why..
I've tried this
$('#redactor').redactor({
focus: true,
plugins: ['fontcolor', 'fontsize'],
formatting: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'],
});
Any help?
You can format the text by adding CSS!
By adding classes to the elements, you could style them like you want to
See the documentation or the example below for more information!
HTML:
JS:
CSS:
If you mean so users can change the font color of headings then basically you can't. I asked why and they replied
"it is done so by design; heading styles should be in CSS" https://twitter.com/imperavi/status/575696417240391681
I had to modify redactor.js in the end and comment out line 4250 to make it work (as it used to):
Or you can just modify the line so that it only affects
headings
. With this change you can nowbold
,italic
,strike-through
, etcheadings
.I wrote a blog article on how to apply a patch to achieve this rather than changing the source.
http://blog.justinleveck.com/2015/12/21/patch-redactor-to-allow-header-formatting/