From be40bfd0ece14356724bc0629b15993bfd684331 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Wed, 14 Jul 2021 00:15:21 +0800 Subject: [PATCH] custom scrollbar size --- _config.yml | 2 ++ source/css/_common/highlight.styl | 3 +-- source/css/_defines/func.styl | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/_config.yml b/_config.yml index 2b7035c..166b556 100755 --- a/_config.yml +++ b/_config.yml @@ -199,6 +199,8 @@ style: animated_avatar: animate: auto # auto, always background: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp + codeblock: + scrollbar: 4px default: avatar: https://cdn.jsdelivr.net/gh/cdn-x/placeholder@1.0.1/avatar/round/3442075.svg diff --git a/source/css/_common/highlight.styl b/source/css/_common/highlight.styl index bb0f23e..8b1d2c4 100644 --- a/source/css/_common/highlight.styl +++ b/source/css/_common/highlight.styl @@ -36,7 +36,7 @@ article.md .highlight margin: 0 background: transparent border: none - scrollbar-codeblock() + scrollbar-codeblock(convert(hexo-config('style.codeblock.scrollbar'))) tr background: transparent &:hover @@ -71,7 +71,6 @@ article.md .highlight .code vertical-align: top &:before - content: "" position: absolute top: 0 right: 0 diff --git a/source/css/_defines/func.styl b/source/css/_defines/func.styl index e0c1068..cd22e4d 100644 --- a/source/css/_defines/func.styl +++ b/source/css/_defines/func.styl @@ -68,10 +68,10 @@ scrollbar($w = 4px, $b = 2px, $c = var(--text-meta), $h = var(--text-p3)) background: $h -scrollbar-codeblock() +scrollbar-codeblock($height = 4px) &::-webkit-scrollbar - height: 4px - width: 4px + height: $height + width: $height &::-webkit-scrollbar-track-piece background: transparent &::-webkit-scrollbar-thumb