CKEditor 5 - 如何告诉它不使用"hsl()"生成颜色,以便我可以将其用于电子邮件内容



我使用的是CKEditor v5,这样用户就可以编辑一些文本,这些文本将包含在Outlook电子邮件客户端可读的电子邮件中。

Outlook似乎不喜欢CKEditor在设置某些文本的颜色时生成的颜色样式:<span style="color:hsl(0, 75%, 60%);">red text</span>

Outlook客户端会忽略颜色样式,并将文本正常呈现。

如何告诉CKEditor使用较旧的颜色样式,例如:<span style="color:#ff1a1a;">red text</span>

您可以在ckeditor.js文件中提供fontColor配置来使用RGB Hexcode,而不是像下面这样的HSL

Editor.defaultConfig = {
toolbar: {
items: ["heading", "bold", "italic", "link"],
shouldNotGroupWhenFull: false,
},
fontSize: {
options: [9, 11, 13, "default", 17, 19, 21],
},
fontColor: {
colors: [{
color: '#E64C4C',
label: 'Red'
},
{
color: '#E6994C',
label: 'Orange'
},
{
color: '#E6E64C',
label: 'Yellow'
},
]
},
// This value must be kept in sync with the language defined in webpack.config.js.
language: "en",
};

CK Editor 5文档链接:https://ckeditor.com/docs/ckeditor5/latest/api/module_font_fontcolor-FontColorConfig.html

相关内容

最新更新