Hello,
I’ve been trying to add more font sizes to the Rich Text Editor than the standard four (small, normal, large, huge). I was able to add more as an option, using this for the Toolbar options:
[
[{ size: ['10px','12px','14px','16px','18px','20px','22px','24px'] }],
['bold', 'italic', 'underline', 'strike'],
[{ list: 'ordered' }, { list: 'bullet' }, { align: [] }],
[{ color: [] }, { background: [] }],
['clean'],
]
and this CSS:
.ql-snow .ql-picker.ql-size .ql-picker-label[data-value]::before,
.ql-snow .ql-picker.ql-size .ql-picker-item[data-value]::before {
content: attr(data-value) !important;
}
This does add a select with the options
But selecting any option doesn’t do anything.
I think this cannot be done from the options available in the editor. I think what’s missing is registering the sizes to the Quill object, which we don’t have any access to.
var Size = Quill.import('attributors/style/size');
Size.whitelist = ['14px', '16px', '18px'];
Quill.register(Size, true);
If anyone knows more or how to do it, please let me know! Thanks ![]()
