TinyMCE Some custom text styles are not selectable, and some are


author

EDIT: Reproducible fiddle for review : https://fiddle.tiny.cloud/P2haab

I'm having trouble creating a custom style formatting configuration option, my text styles sometimes work and sometimes don't. Here are my current style_formats for reference:

style_formats: [
    { title: 'Table Row or List Styles' },
    { title: 'Light Gray', selector: 'tr,ul,ol', classes: 'bg__ltgray' },
    { title: 'Light Blue', selector: 'tr,ul,ol', classes: 'bg__ltblue' },
    { title: 'Light Teal', selector: 'tr,ul,ol', classes: 'bg__ltteal' },
    { title: 'Light Purple', selector: 'tr,ul,ol', classes: 'bg__ltpurple' },
    { title: 'List Styles' },
    { title: 'Dark Teal Text', selector: 'ul,ol', classes: 'text__dkteal' },
    { title: 'Dark Purple Text', selector: 'ul,ol', classes: 'text__dkpurple' },
    { title: 'Dark Blue Text', selector: 'ul,ol', classes: 'text__dkblue' },
    { title: 'Text Styles' },
    { title: 'White Text', inline: 'span', classes: 'text__white' },
    { title: 'Dark Blue Text', inline: 'span', classes: 'text__dkblue' },
    { title: 'Medium Blue Text', inline: 'span', classes: 'text__medblue' },
    { title: 'Dark Green Text', inline: 'span', classes: 'text__dkgreen' },
    { title: 'Dark Teal Text', inline: 'span', classes: 'text__dkteal' },
    { title: 'Dark Purple Text', inline: 'span', classes: 'text__dkpurple' },
    { title: 'Dark Blue Gray Text', inline: 'span', classes: 'text__dkbluegray' },
    { title: 'Medium Blue Gray Text', inline: 'span', classes: 'text__medbluegray' },
    { title: 'Dark Gray Text', inline: 'span', classes: 'text__dkgray' },
    { title: 'Medium Gray Text', inline: 'span', classes: 'text__medgray' },
],
paste_block_drop: false,
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
                    + '.bg__ltgray {background-color: #ededee;}.bg__dkgray {background-color: #a5a7a9;}.bg__dkblue {background-color: #1a315b;}.bg__ltblue {background-color: #cdd6df;}.bg__medblue {background-color: #33587d;}.bg__dkgreen {background-color: #0a492c;}.bg__ltteal {background-color: #ceebeb;}.bg__dkteal {background-color: #00b9ad;}.bg__ltpurple {background-color: #e0d4e1;}.bg__dkpurple {background-color: #652767;}.bg__dkbluegray {background-color: #4b6e8c;}.bg__ltbluegray {background-color: #dbe2e8;}.bg__medbluegray {background-color: #6e8aa3;}.bg__dkgray {background-color: #a5a7a9;}.bg__medgray {background-color: #b9b7bb;}'
                    + '.text__white {color: #ffffff;} .text__dkblue {color: #1a315b;} .text__medblue {color: #33587d;} .text__dkgreen {color: #0a492c;} .text__dkteal {color: #00b9ad;} '
                    + '.text__dkpurple { color: #652767;} .text__dkbluegray { color: #4b6e8c; } .text__medbluegray { color: #6e8aa3; } .text__dkgray { color: #a5a7a9; } '
                    + '.text__medgray { color: #b9b7bb; } '

As you can see, all text styles are exactly the same, however, the user can only select a few options from the list, the other options will show an unavailable mouse cursor, similar to when you try to use the list or table styles (if not desired table or list to which the style is applied).

Specifically, these are what makes the color and is not selectable :

  • Optional:
    • White
    • In blue
    • dark green
    • dark blue gray
    • medium blue grey
    • dark grey
    • grey
  • Not selectable:
    • dark blue
    • Teal
    • dark purple

I can't find any rhyme or reason why these other styles cannot be applied. I've provided a screenshot of the mouse cursor when I try to apply a style that doesn't work. Am I missing something in the config specifically to limit these color/style choices?

TinyMCE style issues

Eric Neisser

It seems like your style names must be globally unique, and "dark blue text" (for example) appears in both "list styles" and "text styles". Changing one of the instances to the only one fixed the issue.

I think the names of styles should be unique only within the part where they appear, but that might just be a limitation of this version of TinyMCE.

Related


TinyMCE Some custom text styles are not selectable, and some are

author EDIT: Reproducible fiddle for review : https://fiddle.tiny.cloud/P2haab I'm having trouble creating a custom style formatting configuration option, my text styles sometimes work and sometimes don't. Here are my current style_formats for reference: style

TinyMCE Some custom text styles are not selectable, and some are

author EDIT: Reproducible fiddle for review : https://fiddle.tiny.cloud/P2haab I'm having trouble creating a custom style formatting configuration option, my text styles sometimes work and sometimes don't. Here are my current style_formats for reference: style

TinyMCE Some custom text styles are not selectable, and some are

author EDIT: Reproducible fiddle for review : https://fiddle.tiny.cloud/P2haab I'm having trouble creating a custom style formatting configuration option, my text styles sometimes work and sometimes don't. Here are my current style_formats for reference: style

TinyMCE Some custom text styles are not selectable, and some are

author EDIT: Reproducible fiddle for review : https://fiddle.tiny.cloud/P2haab I'm having trouble creating a custom style formatting configuration option, my text styles sometimes work and sometimes don't. Here are my current style_formats for reference: style

Add styles to some text

Issam derkaoui Can I add style to part of text from <input>value or a <span>? I have some data like: {text text} an other text... And I'll use styles for text in between {}. My data is:<span>{RFS.KIS.ZWO} JJD000090085077412015021014193191</span> NETCreator ho

Add styles to some text

Issam derkaoui Can I add style to part of text from <input>value or a <span>? I have some data like: {text text} an other text... And I'll use styles for text in between {}. My data is:<span>{RFS.KIS.ZWO} JJD000090085077412015021014193191</span> NETCreator ho

TinyMCE some buttons are not showing

Arko elsenaar I am trying to add link/unlink and image buttons to TinyMCE editor. Right now, I have the following code: tinymce.init({ selector: 'textarea', // change this value according to your HTML toolbar1: 'link unlink image', toolbar2: 'undo redo

TinyMCE some buttons are not showing

Arko elsenaar I am trying to add link/unlink and image buttons to TinyMCE editor. Right now, I have the following code: tinymce.init({ selector: 'textarea', // change this value according to your HTML toolbar1: 'link unlink image', toolbar2: 'undo redo

TinyMCE some buttons are not showing

Arko elsenaar I am trying to add link/unlink and image buttons to TinyMCE editor. Right now, I have the following code: tinymce.init({ selector: 'textarea', // change this value according to your HTML toolbar1: 'link unlink image', toolbar2: 'undo redo

WPF custom control styles only work on some computers

James Wright I've been writing a WPF program with my own AnimatedScrollViewercontrols , which the program inherits from ScrollViewer. It has the following default templates: <Style TargetType="{x:Type Controls:AnimatedScrollViewer}"> <Setter Property="Temp

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

Tinymce shortcut to add custom styles

cache In my tinymce initialization I use a pre-defined style style_formats : [ {title : 'Date', inline : 'span', classes : 'date'}, {title : 'Trend UP', inline : 'span', classes : 'trend_up'}, {title : 'Trend DOWN', inline : 'span', classes : 'tre

Override some styles in SCSS

Leron_says_get_back_Monica I'd like to add a disclaimer, originally I wanted to write this, code reviewbut since I won't be able to provide the full code, I've decided to SOput this question in a better place. That being said, I have a form (more complicated,

Override some styles in SCSS

Leron_says_get_back_Monica I'd like to add a disclaimer, originally I wanted to write this, code reviewbut since I won't be able to provide the full code, I've decided to SOput this question in a better place. That being said, I have a form (more complicated,

How does wxpython textctr change some text styles?

wart cat I have the following problem, I have a textctrl, and I want some text to be different, for example, I want text that ends with a ':' char to be bold. I'm wondering if I can still only change this text, but I haven't found a clear answer. Rolf in Saxon

Text overflow ellipsis not showing in some custom fonts

gu I'm currently trying to make a textbox that hides overflowing text. It works fine, but there are parts. I am using text-overflow: ellipsis; This should put three dots ( ) "..."where my text is truncated , but not three dots, but characters that look like t

Text overflow ellipsis not showing in some custom fonts

gu I'm currently trying to make a textbox that hides overflowing text. It works fine, but there are parts. I am using text-overflow: ellipsis; This should put three dots ( ) "..."where my text is truncated , but not three dots, but characters that look like t

Text overflow ellipsis not showing in some custom fonts

gu I'm currently trying to make a textbox that hides overflowing text. It works fine, but there are parts. I am using text-overflow: ellipsis; This should put three dots ( ) "..."where my text is truncated , but not three dots, but characters that look like t

Text overflow ellipsis not showing in some custom fonts

gu I'm currently trying to make a textbox that hides overflowing text. It works fine, but there are parts. I am using text-overflow: ellipsis; This should put three dots ( ) "..."where my text is truncated , but not three dots, but characters that look like t

HighlightJS happens some CSS styles

Juliet Greetings, I'm trying to use highlight.js via an Ajax call: it pulls data from a PHP script. The codeelement is filled, but it's just the style background and font color (validated in devtools) , and syntax highlighting doesn't happen. I have cleaned th

Some styles do not apply to: after

coding wombat Hello I tried to add styled content :afterthat color: ;will be overwritten, but it text-decoration: ;doesn't work. code.html <html> <head> <style> .separate-hyphen *:not(:last-child):after { content: " -\00a0";

HighlightJS happens some CSS styles

Juliet Greetings, I'm trying to use highlight.js via an Ajax call: it pulls data from a PHP script. The codeelement is filled, but it's just the style background and font color (validated in devtools) , and syntax highlighting doesn't happen. I have cleaned th