Search code examples
quillngx-quill

how to change the dropdown text in Quill?


enter image description herei can change the value of the text but am unable to change the text on the drop down of the ngx-quill

i tried both ways the ts way and the creation of a new container still doesn't fix my issue. went through the doc and still was unable to find a suitable solution to this problem.As the doc doesnt define how to change the labels

html
   <div id="toolBarConfig"></div>
ts
   const sizeVal = Quill.import('attributors/style/size');
    sizeVal.whitelist = ['14px', '16px', '72px'];
    Quill.register(sizeVal, true);
    const quill = new Quill('#toolBarConfig', {
        modules: {
            toolbar: [
                ['bold', 'italic', 'underline', 'strike'],        // toggled buttons
                ['blockquote', 'code-block'],

                [{ header: 1 }, { header: 2 }],               // custom button values
                [{ list: 'ordered' }, { list: 'bullet' }],
                [{ script: 'sub' }, { script: 'super' }],      // superscript/subscript
                [{ indent: '-1' }, { indent: '+1' }],          // outdent/indent
                [{ direction: 'rtl' }],                         // text direction

                [{ size:  ['14px', '16px', '72px']  }],  // custom dropdown
                [{ header: [1, 2, 3, 4, 5, 6, false] }],

                [{ color: [] }, { background: [] }],          // dropdown with defaults from theme
                [{ font: [] }],
                [{ align: [] }],

                ['clean'],
                ['table'],      // remove formatting button

                ['link', 'image', 'video'],                         // 
  link and image, video
            ],
        },
        theme: 'snow',
    });

     SCSS
    .ql-snow .ql-picker.ql-size span[data-label="14px"]::before,
    .ql-snow .ql-picker.ql-size .ql-picker-item[data- 
     value="14px"]::before {
     content: '14px'!important;
     font-size: 14px !important;
   }
    .ql-snow .ql-picker.ql-size span[data-label="16px"]::before,
    .ql-snow .ql-picker.ql-size .ql-picker-item[data- 
     value="16px"]::before {
       content: '16px'!important;
      font-size: 16px !important;
     }
    .ql-snow .ql-picker.ql-size span[data-label="72px"]::before,
    .ql-snow .ql-picker.ql-size .ql-picker-item[data- 
    value="72px"]::before {
      content: '72px'!important;
      font-size: 72px !important;
      }

Solution

  • How to add font types on Quill js with toolbar options?

    follow this stackoverflow thread.. the end resultenter image description here