From 96530a13f76a65d61695d1b42c722b57b555f4ec Mon Sep 17 00:00:00 2001 From: Mitsuki Fukunaga Date: Tue, 10 Nov 2026 07:52:37 +0900 Subject: [PATCH] fix(cm): end the search-button hover colour chain in a literal fallback The chain var(--vscode-button-secondaryHoverBackground, var(--vscode-button-hoverBackground)) had no literal terminal, so a host emitting neither token painted no hover background. Also drop the now-obsolete exception note from the preview palette module. --- scripts/preview/vscode-theme-palettes.mjs | 11 ++++------- src/webview/cm/theme.ts | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/preview/vscode-theme-palettes.mjs b/scripts/preview/vscode-theme-palettes.mjs index 4316aef9..1b999035 100644 --- a/scripts/preview/vscode-theme-palettes.mjs +++ b/scripts/preview/vscode-theme-palettes.mjs @@ -64,13 +64,10 @@ // editor-findMatchBackground, editor-findMatchHighlightBackground, // editor-selectionHighlightBackground) are unstubbed for every themeKind today // and stay that way. Each has a working var(--x, fallback) at its use site, with -// two chains worth knowing about: -// • button-hoverBackground — reached only through -// `var(--vscode-button-secondaryHoverBackground, var(--vscode-button-hoverBackground))` -// (cm/theme.ts, `.cm-panel.cm-search .cm-button:hover`): a two-level chain whose -// terminal arm is itself unstubbed with no literal behind it, so that hover -// surface renders unset HERE but not in a real host (registry hcDark = -// button.background). A genuine harness divergence — cosmetic, dev-only. +// one chain worth knowing about: +// • button-hoverBackground used to be a second chain without a literal terminal; +// it now ends in rgba(128, 128, 128, 0.3), so every unstubbed token has a +// working fallback. // • toolbar-activeBackground — falls back to list-activeSelectionBackground // (styles.css), which HC_DARK omits because the registry hcDark default is null, // so it renders unset under hc-dark. But a real hc-dark host emits neither diff --git a/src/webview/cm/theme.ts b/src/webview/cm/theme.ts index a60ccf9d..c51d29d1 100644 --- a/src/webview/cm/theme.ts +++ b/src/webview/cm/theme.ts @@ -1410,7 +1410,7 @@ export const searchPanelThemeSpec = { }, ".cm-panel.cm-search .cm-button:hover": { backgroundColor: - "var(--vscode-button-secondaryHoverBackground, var(--vscode-button-hoverBackground))", + "var(--vscode-button-secondaryHoverBackground, var(--vscode-button-hoverBackground, rgba(128, 128, 128, 0.3)))", }, ".cm-panel.cm-search label": { fontSize: "var(--vscode-font-size)",