Search code examples
angularquillngx-quill

How to update value of font-size for header in Quill Editor in Angular project


I have a quill editor in my angular project. And all almost done, but I need update font size for H1 for 18px. In the theme it mapped to 2em (~26px) I have try a lot of css selectors but cant find out right selector

<quill-editor placeholder="Text" [modules]="quillConfig" formControlName="text" [style]="{height: '250px'}">
     </quill-editor>

  <div class="quill-toolbar">
    <span class="ql-formats">
      <button class="ql-bold"></button>
      <button class="ql-italic"></button>
      <button class="ql-underline"></button>
      <button class="ql-header" value="1"></button>
    </span>

    <span class="ql-formats">
      <button class="ql-list" value="ordered"></button>
      <button class="ql-list" value="bullet"></button>
    </span>

    <span class="ql-formats">
      <button class="ql-link"></button>
      <button class="ql-image"></button>
      <button class="ql-video"></button>
    </span>
  </div>

quillConfig = {
    toolbar: '.quill-toolbar'
  }

Solution

  • You have to use ::ng-deep

    CSS

    ::ng-deep .ql-snow .ql-editor h1 {
        font-size: 18px;
    }
    

    SCSS

    ::ng-deep {
       .ql-snow .ql-editor h1 {
        font-size: 18px;
       }
    }