From 3354b8adf15b7145b40c19adbc771b5c59a52bd9 Mon Sep 17 00:00:00 2001 From: Andrew Schlaepfer Date: Fri, 22 Feb 2019 10:56:14 -0800 Subject: [PATCH 1/4] turn on styleSelectedText by default, add style for selected search text --- packages/codemirror/src/editor.ts | 2 +- packages/codemirror/style/index.css | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/codemirror/src/editor.ts b/packages/codemirror/src/editor.ts index ed4944909224..b773d81a7d76 100644 --- a/packages/codemirror/src/editor.ts +++ b/packages/codemirror/src/editor.ts @@ -1244,7 +1244,7 @@ export namespace CodeMirrorEditor { lineWiseCopyCut: true, scrollPastEnd: false, styleActiveLine: false, - styleSelectedText: false, + styleSelectedText: true, selectionPointer: false, rulers: [], foldGutter: false diff --git a/packages/codemirror/style/index.css b/packages/codemirror/style/index.css index 89c4d235968f..e51b0e54f631 100644 --- a/packages/codemirror/style/index.css +++ b/packages/codemirror/style/index.css @@ -107,6 +107,10 @@ pre.CodeMirror-line { margin-right: -5px; } +.CodeMirror-selectedtext.cm-searching { + background-color: orangered !important; +} + .CodeMirror-focused .CodeMirror-selected { background-color: var(--jp-editor-selected-focused-background); } From 1fb5462d98dea224239a68e7bbf1102193782322 Mon Sep 17 00:00:00 2001 From: Andrew Schlaepfer Date: Wed, 27 Feb 2019 11:18:02 -0800 Subject: [PATCH 2/4] reflect new default styleSelectedText setting --- packages/codemirror-extension/schema/commands.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/codemirror-extension/schema/commands.json b/packages/codemirror-extension/schema/commands.json index 731b1f9306f6..bb20db156a8e 100644 --- a/packages/codemirror-extension/schema/commands.json +++ b/packages/codemirror-extension/schema/commands.json @@ -32,7 +32,7 @@ "type": "boolean", "title": "Style Selected Text", "description": "Value is boolean", - "default": false + "default": true }, "selectionPointer": { "type": ["boolean", "string"], From 2afb78319f2cc58c42a502743a44e9522b35974d Mon Sep 17 00:00:00 2001 From: Andrew Schlaepfer Date: Fri, 29 Mar 2019 16:49:10 -0700 Subject: [PATCH 3/4] update search colors by theme, change style for unselected match --- packages/codemirror/style/index.css | 10 +++++++++- packages/theme-dark-extension/style/variables.css | 6 ++++++ packages/theme-light-extension/style/variables.css | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/codemirror/style/index.css b/packages/codemirror/style/index.css index e51b0e54f631..deeaa0fad98b 100644 --- a/packages/codemirror/style/index.css +++ b/packages/codemirror/style/index.css @@ -108,7 +108,15 @@ pre.CodeMirror-line { } .CodeMirror-selectedtext.cm-searching { - background-color: orangered !important; + background-color: var(--jp-search-selected-match-background-color) !important; + color: var(--jp-search-selected-match-color) !important; +} + +.cm-searching { + background-color: var( + --jp-search-unselected-match-background-color + ) !important; + color: var(--jp-search-unselected-match-color) !important; } .CodeMirror-focused .CodeMirror-selected { diff --git a/packages/theme-dark-extension/style/variables.css b/packages/theme-dark-extension/style/variables.css index c5493b1e5c25..32ad13cc76ab 100644 --- a/packages/theme-dark-extension/style/variables.css +++ b/packages/theme-dark-extension/style/variables.css @@ -374,4 +374,10 @@ all of MD as it is not optimized for dense, information rich UIs. --jp-search-toggle-off-opacity: 0.5; --jp-search-toggle-hover-opacity: 0.75; --jp-search-toggle-on-opacity: 1; + --jp-search-selected-match-background-color: rgb(255, 225, 0); + --jp-search-selected-match-color: black; + --jp-search-unselected-match-background-color: var( + --jp-inverse-layout-color0 + ); + --jp-search-unselected-match-color: var(--jp-ui-inverse-font-color0); } diff --git a/packages/theme-light-extension/style/variables.css b/packages/theme-light-extension/style/variables.css index ad6f9ad6fd5d..4369d7e1c62e 100644 --- a/packages/theme-light-extension/style/variables.css +++ b/packages/theme-light-extension/style/variables.css @@ -371,4 +371,10 @@ all of MD as it is not optimized for dense, information rich UIs. --jp-search-toggle-off-opacity: 0.4; --jp-search-toggle-hover-opacity: 0.65; --jp-search-toggle-on-opacity: 1; + --jp-search-selected-match-background-color: rgb(255, 245, 0); + --jp-search-selected-match-color: black; + --jp-search-unselected-match-background-color: var( + --jp-inverse-layout-color0 + ); + --jp-search-unselected-match-color: var(--jp-ui-inverse-font-color0); } From 0f037219dec75e0117f9b3197f92cdb3e6b6362e Mon Sep 17 00:00:00 2001 From: Andrew Schlaepfer Date: Mon, 1 Apr 2019 14:53:05 -0700 Subject: [PATCH 4/4] update light theme color --- packages/theme-light-extension/style/variables.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/theme-light-extension/style/variables.css b/packages/theme-light-extension/style/variables.css index 4369d7e1c62e..fb76af41d637 100644 --- a/packages/theme-light-extension/style/variables.css +++ b/packages/theme-light-extension/style/variables.css @@ -371,7 +371,7 @@ all of MD as it is not optimized for dense, information rich UIs. --jp-search-toggle-off-opacity: 0.4; --jp-search-toggle-hover-opacity: 0.65; --jp-search-toggle-on-opacity: 1; - --jp-search-selected-match-background-color: rgb(255, 245, 0); + --jp-search-selected-match-background-color: rgb(245, 200, 0); --jp-search-selected-match-color: black; --jp-search-unselected-match-background-color: var( --jp-inverse-layout-color0