79143021

Date: 2024-10-30 22:49:12
Score: 0.5
Natty:
Report link

you can display the size of the font by pixel

add this line to the toolbar

    //[{ header: [1, 2, 3, 4, 5, 6, false] }],
<ReactQuill
        theme="snow"
        value={""}
        modules={{
          toolbar: [[{ header: [1, 2, 3, 4, 5, 6, false] }]],
        }}
      />

it will display like this:

list of size fonts

if you want to display pixel size instead of 'Heading'

list of size fonts by pixel

add this CSS code to global CSS

.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before {
  content: '32px' !important;
 }

 .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before {
  content: '24px' !important;
 }

 .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before {
  content: '18px' !important;
 }

 .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
  content: '14px' !important;
 }

 .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before {
  content: '10px' !important;
 }

.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before {
  content: '8px' !important;
 }
Reasons:
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ahmed Korany