问题
I have a proglem with quill.js regarding the font sizes. I have added some font sizes
<select title={__("Font size")} className="ql-size">
<option value="8px">8</option>
<option value="9px">9</option>
<option value="10px">10</option>
<option value="11px">11</option>
<option value="12px">12</option>
<option value="14px" selected>14</option>
<option value="18px">18</option>
<option value="24px">24</option>
<option value="30px">30</option>
<option value="36px">36</option>
<option value="48px">48</option>
<option value="60px">60</option>
<option value="72px">72</option>
<option value="96px">96</option>
</select>
And i am not abel to write with anything bigger than 18 , that means the 7th index
Also i wull i have added to the default FONT_SIZE variable inside the library:
FONT_SIZES: {
'8px': 1,
'9px': 2,
'10px': 3,
'11px': 4,
'12px': 5,
'14px': 6,
'18px': 7,
'24px': 8,
'30px': 9,
'36px': 10,
'48px': 11,
'60px': 12,
'72px': 13,
'96px': 14
}
Does anybody know how to fix this?
回答1:
The FONT_SIZE
constant is not meant to be changed and is set due to limitations in the browser. See the fontSize section of https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand. Quill 1.0 is moving away from using execCommand
and should not have this limitation.
来源:https://stackoverflow.com/questions/33018395/quill-js-font-size-issue