ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Change font color of selected text in RTE?

Open sukitsubaki opened this issue 2 years ago • 2 comments

I've looked at the documentation and searched through the issues here in the repository, but am obviously taking the wrong approach, because it can't be that complicated.

In TYPO3 12.4 I want to be able to change the font color of certain text sections in the RTE, but I can't find a way to do this. The result should simply be that the selected text is bracketed by, for example, <span class="firstcolor"></span>.

The colors/classes are defined in a custom CSS, but I can't add new styles to the default dropdown menu that I could select there, nor have I figured out how to install/activate the FontColor or FontBackgroundColor plugins to get the buttons "Font Color" or "Font Background Color" like in the demo WYSIWYG editor in the documentation to change the colors.

I've been stumped for a few hours and hope someone can shed some light on this...

sukitsubaki avatar Feb 04 '24 07:02 sukitsubaki

Hey, CKE5 doesn't provide a way to use "semantic" coloring in the features that you mentioned. Right now they only use inline styles. There's a feature request for improving this: #6557. I am not sure what's the blocker on the TYPO3 side, I would reach to their community for questions regarding this.

I can't add new styles to the default dropdown menu

Most likely you mean style dropdown, as of now, it doesn't insert/change content, it just operates on already present values (rel: #14372).

Witoso avatar Feb 07 '24 09:02 Witoso

The issue lacks the feedback we asked for two weeks. Hence, we've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Feb 22 '24 03:02 CKEditorBot

@sputniklunar the ckeditor font-color-plugin wasn't bundled in the TYPO3 extension. But now it is. https://forge.typo3.org/issues/100847

Class-attributes for color does not work because the ckeditor plugin does not support this, as @Witoso said. But you can use the "highlight" Plugin - example implement / usage: https://github.com/DavidBruchmann/typoscript_ce/tree/ckeditor/

Teisi avatar Mar 04 '24 12:03 Teisi