ppoffice / hexo-theme-icarus

A simple, delicate, and modern theme for the static site generator Hexo.
https://ppoffice.github.io/hexo-theme-icarus/
MIT License
6.28k stars 1.54k forks source link

[Bug] Scrollbar of codeblock with dark highlight theme disappears in Chrome #1145

Closed cmj2002 closed 1 year ago

cmj2002 commented 1 year ago

Make sure you go through the Hexo docs, Icarus user manual, and GitHub issues to see if the bug you are reporting has been already addressed by others.

Describe the bug

The scrollbar of codeblock with dark highlight theme disappears in Chrome. I have tried d11y-dark, github-dark, github-dark-dimmed and their scrollbars all disappeared. It did not happen in the light theme github. Same problem did not happen on Firefox (it use default scrollbar).

Although the scrollbar is not visible, it can still be operated.

The image below is using theme d11y-dark :

image

Same page on FireFox:

image

System and Environment

Hexo: 6.2.0

Output of hexo --version :

hexo: 6.2.0
hexo-cli: 4.3.0
os: linux 5.10.16.3-microsoft-standard-WSL2 Ubuntu 20.04.5 LTS (Focal Fossa)
node: 16.18.0
v8: 9.4.146.26-node.22
uv: 1.43.0
zlib: 1.2.11
brotli: 1.0.9
ares: 1.18.1
modules: 93
nghttp2: 1.47.0
napi: 8
llhttp: 6.0.10
openssl: 1.1.1q+quic
cldr: 41.0
icu: 71.1
tz: 2022b
unicode: 14.0
ngtcp2: 0.8.1
nghttp3: 0.7.0

Icarus: commit 436e134 of this repo, the newest version when writing this issue

Site configuration file (part of it) :

highlight:
  enable: true
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false
prismjs:
  enable: false
  preprocess: true
  line_number: true
  tab_replace: ''

Theme configuration file config.icarus.yml (part of it) :

article:
    highlight:
        theme: a11y-dark
        clipboard: true
        fold: unfolded

Browser: Chrome 107.0.5304.89

To Reproduce

Go to https://e1aaaf01.cmj2002-github-io.pages.dev/ffmpeg-images-to-gif/ in Chrome.

Expected behavior

A scrollbar should appear.

cmj2002 commented 1 year ago

I use a color extractor to try to get the color the scrollbar. Seems the colors of the slider and the background are so similar that i was not able to distinguish them ( rgb(32,32,32) vs rgb(40,40,40) )

Anyway, maybe I shouldn't call it a bug. Should I close the issue?

cmj2002 commented 1 year ago

I managed to change the CSS style and fix it by adding:

figure.highlight .highlight-body::-webkit-scrollbar-thumb {
  background-color: #808080;
}