angular - 如何在Angular项目的Quill Editor中更新标题的字体大小值

标签 angular quill ngx-quill

我的 angular 项目中有一个羽毛笔编辑器。
一切都差不多完成了,但我需要将 H1 的字体大小更新为 18px。
在主题中它映射到 2em (~26px)
我尝试了很多 css 选择器,但找不到正确的选择器

<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'
  }

最佳答案

您必须使用 ::ng-deep
CSS

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

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

关于angular - 如何在Angular项目的Quill Editor中更新标题的字体大小值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57494150/

相关文章:

angular - 从对象数组中过滤值

angular - 如果我无法确定生产中需要什么重定向 URI,我该如何使用 OAuth2?

css - 有没有更好的方法来包含 npm 安装的 CSS 文件?

angular - 如何在 Angular 应用程序中添加自定义 Quill 工具栏

angular6 - 如何在 JHipster 项目中渲染没有 html 标签的 ngx-quill-editor 内容?

javascript - Angular 4嵌套FormArrays无法读取null的属性 'push'

QuillJS : Customize attr alt

angular - 用 Angular 2 覆盖羽毛笔编辑器链接

angular - 如何在 Angular/ typescript 中正确覆盖子类中基类的属性? ngx-quill 和 Material

angular - 在 beforeEach 中声明变量