From 5038e352f756325af4af6fb42068c0920d6b6092 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Sun, 12 Apr 2026 23:10:13 +0800 Subject: [PATCH] fix(frontend): restore os-theme-codeg scrollbar theme lost during merge The merge commit ee60536 dropped the custom OverlayScrollbars theme definition from globals.css, leaving scrollbar handles with zero size and no background color. Restore the theme with a compound selector (.os-scrollbar.os-theme-codeg) to ensure higher specificity than the library's base defaults regardless of CSS load order. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/globals.css | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/app/globals.css b/src/app/globals.css index da61632..907d1c4 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1001,14 +1001,30 @@ } } -/* Unified scrollbar style for scrollable containers. - Thin overlay scrollbar — no gutter reserved, no layout shift. */ -.scrollbar-thin, -.scrollbar-thin-edge { +/* Native fallback for containers that cannot use OverlayScrollbars (e.g. virtua) */ +.scrollbar-thin { scrollbar-width: thin; scrollbar-color: var(--border) transparent; } +/* OverlayScrollbars custom theme — 6px track, grows to 8px on hover. + Use compound selector to beat the base `.os-scrollbar` defaults + (--os-size:0, --os-handle-bg:none) regardless of CSS load order. */ +.os-scrollbar.os-theme-codeg { + --os-size: 6px; + --os-handle-bg: var(--border); + --os-handle-bg-hover: var(--muted-foreground); + --os-handle-bg-active: var(--muted-foreground); + --os-handle-border-radius: 999px; + --os-handle-perpendicular-size: 100%; + --os-handle-perpendicular-size-hover: 100%; + --os-handle-perpendicular-size-active: 100%; +} + +.os-scrollbar.os-theme-codeg:hover { + --os-size: 8px; +} + /* Streamdown code blocks: dark mode via shiki dual-theme CSS variables */ .dark [data-streamdown="code-block-body"] { background-color: var(--shiki-dark-bg, var(--sdm-bg, transparent)) !important;