更换Quill Renderer后部分样式失效问题求助
Quill Renderer替换后图片边框样式失效
我们网站采用TypeScript、Mithril JS、Quill JS(含Quill Renderer)及Sass技术栈。更换为Quill Renderer后,此前正常生效的图片边框样式失效了。代码库包含多张样式表,我怀疑样式被其他表覆盖,但测试后没有任何变化。
效果对比
- 期望效果:带边框的图片
- 实际效果:无边框的图片
已尝试的无效方案
- 复制代码库中其他页面的完整有效样式表
- 在样式中添加
!important标记 - 使用Parchment创建自定义内联/Blot
- 开发者工具中手动应用该样式时边框能正常显示,说明样式表已被识别,但前端页面中就是不生效
尝试的代码示例
自定义Parchment代码
class BorderedFigure extends Block { static blotName = 'bordered-figure'; static tagName = 'div'; static create() { const node = super.create(); node.classList.add('bordered-figure') return node; } static formats(domNode: HTMLElement) { return domNode.classList.contains('overflow-figure'); } remove() { super.remove(); } }
Sass样式表代码
.bordered-figure, .bordered-figure-true border: 4px solid $autosprink-blue border-radius: 4px box-shadow: 0 0 20px black display: inline-block line-height: 0
内容的提问来源于stack exchange,提问作者Rick Ansay
相关产品推荐
相关产品推荐

