From 27d230e50118e4051649d5863fbf52cbef71824d Mon Sep 17 00:00:00 2001 From: typist Date: Wed, 29 Oct 2025 05:35:58 +0800 Subject: [PATCH] feat: add custom scrollbar styles for light and dark themes - Implemented custom scrollbar styles in src/index.css for improved aesthetics. - Added styles for both light and dark themes, enhancing user experience across different modes. --- src/index.css | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/src/index.css b/src/index.css index 3830205..9f52dc8 100644 --- a/src/index.css +++ b/src/index.css @@ -117,4 +117,51 @@ body { @apply bg-background text-foreground; } +} + +/* 自定义滚动条样式 */ +* { + scrollbar-width: thin; + scrollbar-color: oklch(0.551 0.027 264.364 / 0.3) transparent; +} + +*::-webkit-scrollbar { + width: 8px; + height: 8px; +} + +*::-webkit-scrollbar-track { + background: transparent; + border-radius: 4px; +} + +*::-webkit-scrollbar-thumb { + background: oklch(0.551 0.027 264.364 / 0.3); + border-radius: 4px; + transition: background 0.2s ease; +} + +*::-webkit-scrollbar-thumb:hover { + background: oklch(0.551 0.027 264.364 / 0.5); +} + +*::-webkit-scrollbar-thumb:active { + background: oklch(0.551 0.027 264.364 / 0.6); +} + +/* 深色模式下的滚动条 */ +.dark *::-webkit-scrollbar-thumb { + background: oklch(0.707 0.022 261.325 / 0.4); +} + +.dark *::-webkit-scrollbar-thumb:hover { + background: oklch(0.707 0.022 261.325 / 0.6); +} + +.dark *::-webkit-scrollbar-thumb:active { + background: oklch(0.707 0.022 261.325 / 0.7); +} + +.dark * { + scrollbar-color: oklch(0.707 0.022 261.325 / 0.4) transparent; } \ No newline at end of file