How to add font-color and font-size in react/js ckeditor 5

Viewed 1209

I am using ckeditor 5 in my react project and i wanted to add font-Color in my editor. I am trying to add font plugin but i am getting error ckeditor-duplicated-modules. Any one work on this please tell me how to do this.

import CKEditor from "@ckeditor/ckeditor5-react";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import Font from '@ckeditor/ckeditor5-font/src/font';

return (
    <div>
        <CKEditor
            editor={ClassicEditor}
            config={{
            plugins: [ Font ],
            toolbar: [
                'heading',  'bold', 'italic', 'fontColor','bulletedList', 'numberedList', 
                'undo', 'redo'
            ],
            fontColor: {
            colors: [
                {
                    color: 'hsl(0, 0%, 0%)',
                    label: 'Black'
                },
                {
                    color: 'hsl(0, 0%, 30%)',
                    label: 'Dim grey'
                },
                // ...
                ]
            },
            }}
            data={this.state.data}
            onChange={this.handleCkeditorState}
            onInit={(editor) => {
            this.setState({
                data: `<div>
                    ${messages.messageHTML}
                    </div>`,
            });
            }}
        />
    </div>
)

Error: CKEditorError: ckeditor-duplicated-modules Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-ckeditor-duplicated-modules

0 Answers
Related