防止在 CKEditor 5 中添加“.ck-reset”类
Prevent from being added ".ck-reset" classes in CKEditor 5
默认情况下,CK-Editor 添加重置 CSS 类 像 ".ck-reset":
.ck.ck-reset, .ck.ck-reset_all, .ck.ck-reset_all * {
margin: 0;
padding: 0;
border: 0;
background: transparent;
text-decoration: none;
vertical-align: middle;
transition: none;
word-wrap: break-word;
}
如果我不想要这些 类 怎么办?哪个选项对应禁用CSS重置类?
有几种方法可以尝试解决这个问题(从下面的 GH 问题中复制):
- 一个自定义的 PostCSS 插件,将所有 .ck-reset 语句替换为 :not(.some-component) .ck-reset 以禁用组件中的 CKEditor 5 重置。
- Package.json 关卡脚本,将 _reset.css 文件替换为您自己的 css 文件,其中包含 not(.some-component)
- 等待问题得到解决,根据 - https://github.com/ckeditor/ckeditor5/issues/3424
默认情况下,CK-Editor 添加重置 CSS 类 像 ".ck-reset":
.ck.ck-reset, .ck.ck-reset_all, .ck.ck-reset_all * {
margin: 0;
padding: 0;
border: 0;
background: transparent;
text-decoration: none;
vertical-align: middle;
transition: none;
word-wrap: break-word;
}
如果我不想要这些 类 怎么办?哪个选项对应禁用CSS重置类?
有几种方法可以尝试解决这个问题(从下面的 GH 问题中复制):
- 一个自定义的 PostCSS 插件,将所有 .ck-reset 语句替换为 :not(.some-component) .ck-reset 以禁用组件中的 CKEditor 5 重置。
- Package.json 关卡脚本,将 _reset.css 文件替换为您自己的 css 文件,其中包含 not(.some-component)
- 等待问题得到解决,根据 - https://github.com/ckeditor/ckeditor5/issues/3424