You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

更换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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.17 07:12:41