我的 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/