From cdad4a32ff08855c56aef95383a9687988667ac8 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Sun, 7 Jun 2026 23:13:31 +0800 Subject: [PATCH] fix(editor): soften selection match highlights --- .../src/lib/codemirrorSelectionMatches.ts | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/apps/desktop/src/lib/codemirrorSelectionMatches.ts b/apps/desktop/src/lib/codemirrorSelectionMatches.ts index feab1c84b7..4b8e56195a 100644 --- a/apps/desktop/src/lib/codemirrorSelectionMatches.ts +++ b/apps/desktop/src/lib/codemirrorSelectionMatches.ts @@ -101,17 +101,28 @@ export function selectionMatchOccurrences(): Extension { maxMatches: 500, }), selectionMatchScrollbar, - EditorView.baseTheme({ + EditorView.theme({ "&": { + "--dbx-selection-match-background": "rgb(59 130 246 / 0.07)", + "--dbx-selection-match-border": "rgb(59 130 246 / 0.24)", + "--dbx-selection-match-main-background": "rgb(59 130 246 / 0.11)", + "--dbx-selection-match-main-border": "rgb(59 130 246 / 0.36)", position: "relative", }, + ".dark &": { + "--dbx-selection-match-background": "rgb(147 197 253 / 0.12)", + "--dbx-selection-match-border": "rgb(147 197 253 / 0.3)", + "--dbx-selection-match-main-background": "rgb(147 197 253 / 0.18)", + "--dbx-selection-match-main-border": "rgb(147 197 253 / 0.42)", + }, ".cm-selectionMatch": { - backgroundColor: "color-mix(in oklab, var(--foreground) 8%, transparent)", - outline: "1px solid color-mix(in oklab, var(--foreground) 10%, transparent)", + backgroundColor: "var(--dbx-selection-match-background)", + borderRadius: "2px", + boxShadow: "inset 0 0 0 1px var(--dbx-selection-match-border)", }, ".cm-selectionMatch-main": { - backgroundColor: "color-mix(in oklab, var(--primary) 14%, transparent)", - outline: "1px solid color-mix(in oklab, var(--primary) 24%, transparent)", + backgroundColor: "var(--dbx-selection-match-main-background)", + boxShadow: "inset 0 0 0 1px var(--dbx-selection-match-main-border)", }, ".cm-selectionMatchScrollbarLayer": { bottom: "2px",