Hilitecolor / Forecolor custom formats can not produce valid css class
See original GitHub issueWhat is the current behavior? Describe the bug
Forecolor / Hilitecolor use inline styles to set color. We want custom css classes to do this. But using custom formats to create a css class produces invalid css classes, as the value always returns a ‘#’
using following will always produce invalid css
hilitecolor: { inline: 'span', classes: 'hilitecolor-%value' }, forecolor: { inline: 'span', classes: 'forecolor-%value' },
** steps to reproduce **
http://fiddle.tiny.cloud/qrhaab
What is the expected behavior?
We can use custom formats to produce valid css, by removing “#” from the substituted value
Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE? All versions of 5
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
formats - TinyMCE
This example overrides some of the built in formats and tells TinyMCE to apply classes instead of inline styles. It also includes a...
Read more >How to add a highlight color option to TinyMCE? - ProcessWire
I have a client who requested the ability to highlight text (basically change the CSS background color between a few options).
Read more >CSS Variables — No, really! - Medium
Recall that CSS variables are just property/value pairs; you define them exactly as you would properties of any valid selector, except with ...
Read more >Dijit Editor - Archived Tutorial - Dojo Toolkit
Dijit's Editor widget is everything a developer looks for in a WYSIWYG editor: ... The class doesn't actually have to be applied to...
Read more >CSS class selectors not changing anything - Stack Overflow
It's because your class names begin with number, which is not allowed in CSS. Revert the name and number, eg: .sec5{ color: green;...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright, sounds like your on a path to a solution. Here are more ideas on how to create custom menus and toolbars for choosing colors. Inpect the source code for detailed documentations. https://tinymce.github.io/tinymce-demos/tinymce-basics/custom-toolbar-button-menu-and-context-toolbar.html https://tinymce.github.io/tinymce-demos/tinymce-basics/customizing-the-table-toolbar.html
Looking at the style formats, i think this is the way to go instead of using background-color.
with the Hilitecolor we actually want to use produce something like “<mark> test </mark>” instead of setting the background color.