From 1ef1e02b867d1393de358bf3e2da5bb644f5bb6f Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Thu, 5 Nov 2020 06:04:37 -0500 Subject: [PATCH] Fine tune CodeMirror search highlight rendering --- src/css/codemirror.css | 11 +++++++++++ src/css/themes/default.css | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/css/codemirror.css b/src/css/codemirror.css index b1160f001..4bd080e99 100644 --- a/src/css/codemirror.css +++ b/src/css/codemirror.css @@ -35,6 +35,17 @@ } /* CodeMirror theme overrides */ +.CodeMirror-focused .CodeMirror-selected { + background: var(--cm-selection-surface); + color: var(--cm-selection-ink); + } +.CodeMirror-line::selection, +.CodeMirror-line > span::selection, +.CodeMirror-line > span > span::selection { + background: var(--cm-selection-surface); + color: var(--cm-selection-ink); + } + .cm-s-default .cm-comment { color: var(--sf-comment-ink); } diff --git a/src/css/themes/default.css b/src/css/themes/default.css index 5ac11e1c6..0d2dbb511 100644 --- a/src/css/themes/default.css +++ b/src/css/themes/default.css @@ -180,7 +180,9 @@ --cm-gutter-border: var(--light-gray-40); --cm-gutter-ink: var(--light-gray-90); --cm-gutter-surface: var(--light-gray-25); - --cm-searching-surface: var(--yellow-10); + --cm-selection-surface: #d7d4f0; + --cm-selection-ink: var(--default-ink); + --cm-searching-surface: #ffff0066; /* syntax highlight: static filtering */ --sf-comment-ink: var(--light-gray-90);