From e4b0eb09f0879e517907d369b5001ed04eb8ee3d Mon Sep 17 00:00:00 2001 From: myk1yt Date: Sat, 31 Oct 2026 00:24:48 +0900 Subject: [PATCH] chore(webview): remove dead CSS classes from the global stylesheet What: - Drop the `.border-x` / `.border-y` selectors from the `@layer components` border-color rule (`.border`, `.border-r`, `.border-l`, `.border-t`, `.border-b` stay). - Drop `.animate-smooth-bounce` (the `smooth-bounce` keyframe stays: RooHero applies it through an inline `animation` style). - Drop the `.code-block-scrollable` selectors: the two border/transition rules and the five `::-webkit-scrollbar-*` rules plus their comment block. `.scrollable` and its `body:hover` / `body:focus-within` variants stay. - Drop `.custom-markdown > pre` and `.animate-slide-in-right` together with its now-orphaned `slide-in-right` keyframe. Why: - Every removed class has zero references across the tracked tree (`git grep -- . ':!webview-ui/src/index.css'` returns 0 for each). No component, test, visual fixture, or dependency emits them. The `.code-block-scrollable` emitter was deleted upstream when the className was commented out; the stylesheet rules were left behind. - `.animate-smooth-bounce` was never applied: RooHero.tsx:24 sets `animation: "smooth-bounce 1s ease-in-out infinite"` directly, which is why the keyframe must stay and only the wrapper class goes. Impact: - No runtime behavior change. The built stylesheet keeps every live sibling (verified against `src/webview-ui/build/assets/index.css`: `animate-fade-in`, `smooth-bounce`, and `scrollable` are all still emitted; the four removed names are absent). - 63 lines removed, 3 lines added (the shortened selector terminators). - Also normalizes this file's line endings to LF to match the committed blob, which incidentally clears a pre-existing Prettier failure on the file. Deliberately out of scope (kept): `.dropdown-container`. The seats disagree on whether it is dead, and it is a documented toolkit dropdown pattern, so it is deferred to a NEEDS-TEST unit rather than decided here. --- webview-ui/src/index.css | 66 ++-------------------------------------- 1 file changed, 3 insertions(+), 63 deletions(-) diff --git a/webview-ui/src/index.css b/webview-ui/src/index.css index bccbdf7031..de889f4168 100644 --- a/webview-ui/src/index.css +++ b/webview-ui/src/index.css @@ -199,9 +199,7 @@ .border-r, .border-l, .border-t, - .border-b, - .border-x, - .border-y { + .border-b { border-color: var(--border); } @@ -234,10 +232,6 @@ transform: translateY(0); } } - - .animate-smooth-bounce { - animation: smooth-bounce 1s ease-in-out infinite; - } } /* Form Element Focus States */ @@ -274,9 +268,7 @@ body { } body.scrollable, -.scrollable, -body.code-block-scrollable, -.code-block-scrollable { +.scrollable { border-color: transparent; transition: border-color 0.7s linear; } @@ -284,11 +276,7 @@ body.code-block-scrollable, body:hover.scrollable, body:hover .scrollable, body:focus-within.scrollable, -body:focus-within .scrollable, -body:hover.code-block-scrollable, -body:hover .code-block-scrollable, -body:focus-within.code-block-scrollable, -body:focus-within .code-block-scrollable { +body:focus-within .scrollable { border-color: var(--vscode-scrollbarSlider-background); transition: none; } @@ -323,33 +311,6 @@ body:focus-within .code-block-scrollable { } } -/** - * The above scrollbar styling uses some transparent background color magic to accomplish its animation. However this doesn't play nicely with SyntaxHighlighter, so we need to set a background color for the code blocks' horizontal scrollbar. This actually has the unintended consequence of always showing the scrollbar which I prefer since it makes it more obvious that there is more content to scroll to. - */ - -.code-block-scrollable::-webkit-scrollbar-track { - background: transparent; -} - -.code-block-scrollable::-webkit-scrollbar-thumb { - background-color: var(--vscode-scrollbarSlider-background); - border-radius: 5px; - border: 2px solid transparent; - background-clip: content-box; -} - -.code-block-scrollable::-webkit-scrollbar-thumb:hover { - background-color: var(--vscode-scrollbarSlider-hoverBackground); -} - -.code-block-scrollable::-webkit-scrollbar-thumb:active { - background-color: var(--vscode-scrollbarSlider-activeBackground); -} - -.code-block-scrollable::-webkit-scrollbar-corner { - background-color: transparent; -} - /** * Add a way to hide scrollbars. */ @@ -463,14 +424,6 @@ input[cmdk-input]:focus { outline: none; } -/** - * Markdown - */ - -.custom-markdown > pre { - background-color: transparent !important; -} - /* * Use geometric precision for codicons to avoid blurriness */ @@ -483,19 +436,6 @@ input[cmdk-input]:focus { * Custom animations for UI elements */ -@keyframes slide-in-right { - from { - transform: translateX(100%); - } - to { - transform: translateX(0); - } -} - -.animate-slide-in-right { - animation: slide-in-right 0.3s ease-out; -} - @keyframes fade-in { from { opacity: 0;