-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom colors added to colorButton_colors in form label/code don't work at all #1478
Comments
There are three places where color is used:
When color is defined like
If you switch the config like
See (codepen sample). The documentation says:
IMHO, it describes the above behaviour (in a little confusing way). There is So it works according to the specification, but I have to admit this behavior is quite unintuitive. |
Hello, I just stumbled across this issue while trying to make ckeditor color configuration changes. I had set custom colors on top of default ones, using only hexadecimal values, and thought "why not add labels so it's easier to distinguish them", and followed the instructions from the documentation and used the I end up being disapointed that it wouldn't work anymore, and I'm not sure if it's working as specified, or just a bug, but what I'm convinced is that there should be a pattern to support the following output (as explained above), which is the most intuitive / natural / expected when reading the documentation :
|
It is indeed very counter-intuitive and confusing. I placed them also in the wrong order... |
Most obvious use case for me is: User wants to predefine some custom colors with names to distinguish them easier.
Here is example of how this currently works: We should change color applied to match second part of config option and update docs, so there are no more confusions on how to use it. |
Are you reporting a feature request or a bug?
Bug
Check if the issue is already reported
Provide detailed reproduction steps (if any)
colorButton_colors : 'highlight_yellow/FFFF00',
Expected result
The color tooltip should be
highlight_yellow
The color applied should be visible in the editor and when switching to source mode, the code should be
highlight_yellow
,Actual result
The color tooltip is
FFFF00
The color applied is not visible in the editor and when switching to source mode, the label is applied
FFFF00
and not the label.Other details
As you will read in ticket https://dev.ckeditor.com/ticket/11679, you also can't apply clsses that way.
Colors are applied based on code only https://github.com/ckeditor/ckeditor-dev/blob/master/plugins/colorbutton/plugin.js#L273. Searching name by the color in lang file is good but the *[second option should be] the custom label and the code itself should be treated as last resort.
FFF00
color is already defined in the lang file. Perhaps a better option would be making the label the first choice since user has defined it, the second should be language file search based on code and the last should be the code itself.I also think that documentation should be improved for this configuration setting.
The text was updated successfully, but these errors were encountered: