From f28f0077b8e6fec09052e26a739ad0b6b8c1c902 Mon Sep 17 00:00:00 2001 From: MicroBlock <66859419+std-microblock@users.noreply.github.com> Date: Wed, 3 Dec 2025 13:13:07 +0800 Subject: [PATCH 1/5] feat: improve scrollbar --- src/styles/custom.css | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/styles/custom.css b/src/styles/custom.css index 40c659d5..514b660f 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -28,3 +28,36 @@ .sl-markdown-content pre > code { font-size: 1em; } + +/* Custom scrollbar */ +:root[data-theme="light"] ::-webkit-scrollbar-track { + background: #f1f1f1; +} + +:root[data-theme="light"] ::-webkit-scrollbar-thumb { + background: #888; +} + +:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { + background: #555; +} + +:root[data-theme="dark"] ::-webkit-scrollbar-track { + background: #2a2a2a; +} + +:root[data-theme="dark"] ::-webkit-scrollbar-thumb { + background: #666; +} + +:root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { + background: #aaa; +} + +::-webkit-scrollbar { + width: 8px; +} + +::-webkit-scrollbar-thumb { + border-radius: 4px; +} From 5809047116fd7a87ed256b403912f6e28d9bb329 Mon Sep 17 00:00:00 2001 From: MicroBlock <66859419+std-microblock@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:56:53 +0800 Subject: [PATCH 2/5] fix: improve scrollbar and support firefox --- src/styles/custom.css | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/styles/custom.css b/src/styles/custom.css index 514b660f..83007ff8 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -30,34 +30,41 @@ } /* Custom scrollbar */ -:root[data-theme="light"] ::-webkit-scrollbar-track { - background: #f1f1f1; +::-webkit-scrollbar { + width: 4px; +} + +::-webkit-scrollbar-track { + background-color: #F5F5F5; + border-radius: 2px; } -:root[data-theme="light"] ::-webkit-scrollbar-thumb { - background: #888; +::-webkit-scrollbar-thumb { + background-color: #C1C1C1; + border-radius: 2px; } -:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover { - background: #555; +::-webkit-scrollbar-thumb:hover { + background-color: #A8A8A8; } :root[data-theme="dark"] ::-webkit-scrollbar-track { - background: #2a2a2a; + background-color: #2D2A32; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb { - background: #666; + background-color: #4A4458; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { - background: #aaa; + background-color: #5A5466; } -::-webkit-scrollbar { - width: 8px; +* { + scrollbar-width: thin; + scrollbar-color: #C1C1C1 #F5F5F5; } -::-webkit-scrollbar-thumb { - border-radius: 4px; +:root[data-theme="dark"] * { + scrollbar-color: #4A4458 #2D2A32; } From 66d798d98724de52045ef17ed1e6e44d17b90bb2 Mon Sep 17 00:00:00 2001 From: MicroBlock <66859419+std-microblock@users.noreply.github.com> Date: Wed, 3 Dec 2025 14:58:26 +0800 Subject: [PATCH 3/5] style: reformat code --- src/styles/custom.css | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/styles/custom.css b/src/styles/custom.css index 83007ff8..d35a81b3 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -31,40 +31,40 @@ /* Custom scrollbar */ ::-webkit-scrollbar { - width: 4px; + width: 4px; } ::-webkit-scrollbar-track { - background-color: #F5F5F5; - border-radius: 2px; + background-color: #f5f5f5; + border-radius: 2px; } ::-webkit-scrollbar-thumb { - background-color: #C1C1C1; - border-radius: 2px; + background-color: #c1c1c1; + border-radius: 2px; } ::-webkit-scrollbar-thumb:hover { - background-color: #A8A8A8; + background-color: #a8a8a8; } :root[data-theme="dark"] ::-webkit-scrollbar-track { - background-color: #2D2A32; + background-color: #2d2a32; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb { - background-color: #4A4458; + background-color: #4a4458; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { - background-color: #5A5466; + background-color: #5a5466; } * { - scrollbar-width: thin; - scrollbar-color: #C1C1C1 #F5F5F5; + scrollbar-width: thin; + scrollbar-color: #c1c1c1 #f5f5f5; } :root[data-theme="dark"] * { - scrollbar-color: #4A4458 #2D2A32; + scrollbar-color: #4a4458 #2d2a32; } From 60f06b433046f2a6ea604733981e35f4b575624b Mon Sep 17 00:00:00 2001 From: MicroBlock <66859419+std-microblock@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:06:41 +0800 Subject: [PATCH 4/5] adjust colors --- src/styles/custom.css | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/styles/custom.css b/src/styles/custom.css index d35a81b3..efbe0668 100644 --- a/src/styles/custom.css +++ b/src/styles/custom.css @@ -35,36 +35,36 @@ } ::-webkit-scrollbar-track { - background-color: #f5f5f5; + background-color: #e6f3ff; border-radius: 2px; } ::-webkit-scrollbar-thumb { - background-color: #c1c1c1; + background-color: #87ceeb; border-radius: 2px; } ::-webkit-scrollbar-thumb:hover { - background-color: #a8a8a8; + background-color: #4682b4; } :root[data-theme="dark"] ::-webkit-scrollbar-track { - background-color: #2d2a32; + background-color: #1e3a5f; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb { - background-color: #4a4458; + background-color: #4a90e2; } :root[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { - background-color: #5a5466; + background-color: #5b9bd5; } * { scrollbar-width: thin; - scrollbar-color: #c1c1c1 #f5f5f5; + scrollbar-color: #87ceeb #e6f3ff; } :root[data-theme="dark"] * { - scrollbar-color: #4a4458 #2d2a32; + scrollbar-color: #4a90e2 #1e3a5f; } From 5a4261809502ccb92927661aa833dd55704e3b30 Mon Sep 17 00:00:00 2001 From: MicroBlock <66859419+std-microblock@users.noreply.github.com> Date: Wed, 3 Dec 2025 15:08:36 +0800 Subject: [PATCH 5/5] do not show scrollbar for decl if not needed --- src/components/decl-doc/Decl.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/decl-doc/Decl.astro b/src/components/decl-doc/Decl.astro index 58333d8d..d20aff35 100644 --- a/src/components/decl-doc/Decl.astro +++ b/src/components/decl-doc/Decl.astro @@ -10,7 +10,7 @@ .decl { background-color: var(--sl-color-gray-6); border-bottom: 1px solid var(--sl-color-gray-5); - overflow: scroll; + overflow: auto; margin: 0; padding: 0 1em; }