fluid-dev / hexo-theme-fluid

:ocean: 一款 Material Design 风格的 Hexo 主题 / An elegant Material-Design theme for Hexo
https://hexo.fluid-dev.com/
GNU General Public License v3.0
7.24k stars 1.13k forks source link

Giscus评论插件错误的CSS样式 #1039

Closed H2Sxxa closed 8 months ago

H2Sxxa commented 9 months ago

请确认

Bug 描述

Fluid更新到1.9.7后,评论插件出现了错误的样式

6220a1800b40b2adc9366137b2737b82 2d118812d463b5a3404f5700c0dc7503

giscus.style.cssText += 'color-scheme: normal;';注释后恢复正常,控制台不再抛出错误

    // 设置 giscus 评论主题
    var giscus = document.querySelector('iframe.giscus-frame');
    if (giscus) {
      var giscusTheme = schema === 'dark' ? window.GiscusThemeDark : window.GiscusThemeLight;
      const message = {
        setConfig: {
          theme: giscusTheme,
        }
      };
      // giscus.style.cssText += 'color-scheme: normal;';
      giscus.contentWindow.postMessage({ 'giscus': message }, 'https://giscus.app'); 
    }

image

我不确定是不是我的问题, 与 #978 有关,由于我不熟悉 JavaScript,所以将此问题进行汇报

Giscus也有相关错误汇报 https://github.com/giscus/giscus/issues/675#issuecomment-1304908689

up: 在他人博客中得到复现,大概能确认是这个问题,具体原理不清楚

复现步骤

  1. 配置 Giscus 评论插件
  2. 访问
EastMonster commented 8 months ago

same problem

mobeicanyue commented 8 months ago

您好,您的giscus评论,在白色背景下会出现边框不完整吗? image

H2Sxxa commented 8 months ago

您好,您的giscus评论,在白色背景下会出现边框不完整吗? image

image

并不会,我觉得这种情况应该另有原因,不在此issue的讨论范围之内

llleixx commented 2 months ago

注释掉后颜色能正常显示。但现版本似乎仍然有控制台报错?

image

H2Sxxa commented 2 months ago

注释掉后颜色能正常显示。但现版本似乎仍然有控制台报错?

image

我还没有更新我的博客主题到最新版本......😭

你可以试试自己复现一下,这个问题对于评论似乎没有影响。